Advertisement
Urbanecm

addmissing.py - error

Jan 22nd, 2017
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
  2. $ cat pages.txt
  3. Battle_of_San_Patricio
  4. Heritage_Foundation
  5. Jan_Christian_Smuts
  6. Makronky
  7. Start_Linuxového_systému
  8. Stephen_Marley
  9. urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
  10. $ cat runAddMissing.sh
  11. #!/bin/bash
  12.  
  13. python3 addmissing.py -file:pages.txt -search:'-insource:/\{\{[Pp]řeklad/'
  14. urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
  15. $ bash runAddMissing.sh
  16. Retrieving 50 pages from wikipedia:cs.
  17. WARNING: Page "Battle of San Patricio" on wikipedia:cs is skipped because it is a redirect
  18. WARNING: Page "Heritage Foundation" on wikipedia:cs is skipped because it is a redirect
  19. WARNING: Page "Jan Christian Smuts" on wikipedia:cs is skipped because it is a redirect
  20. WARNING: Page "Makronky" on wikipedia:cs is skipped because it is a redirect
  21. WARNING: Page "Start Linuxového systému" on wikipedia:cs is skipped because it is a redirect
  22.  
  23.  
  24. >>> Stephen Marley <<<
  25. No changes were needed on [[Stephen Marley]]
  26.  
  27.  
  28. >>> 1. slovenská fotbalová liga <<<
  29.  
  30. 6 pages read
  31. 0 pages written
  32. Execution time: 7 seconds
  33. Read operation time: 1 seconds
  34. Script terminated by exception:
  35.  
  36. ERROR: KeyError: '1._slovenská_fotbalová_liga'
  37. Traceback (most recent call last):
  38. File "addmissing.py", line 223, in <module>
  39. main()
  40. File "addmissing.py", line 216, in main
  41. bot.run() # guess what it does
  42. File "/shared/pywikipedia/core/pywikibot/bot.py", line 1434, in run
  43. self.treat(page)
  44. File "/shared/pywikipedia/core/pywikibot/bot.py", line 1721, in treat
  45. super(ExistingPageBot, self).treat(page)
  46. File "/shared/pywikipedia/core/pywikibot/bot.py", line 1785, in treat
  47. super(NoRedirectPageBot, self).treat(page)
  48. File "/shared/pywikipedia/core/pywikibot/bot.py", line 1648, in treat
  49. self.treat_page()
  50. File "addmissing.py", line 153, in treat_page
  51. preklad = nahrady[self.current_page.title(underscore=True)]
  52. KeyError: '1._slovenská_fotbalová_liga'
  53. <class 'KeyError'>
  54. CRITICAL: Closing network session.
  55. urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
  56. $ cat preklads.txt
  57. Battle_of_San_Patricio {{Překlad|en|Battle of San Patricio|681532466}}
  58. Makronky {{Překlad|en|Macaron|702131015}}
  59. Stephen_Marley {{Překlad|en|Stephen Marley (musician)|705380410}}
  60. Jan_Christian_Smuts {{Překlad|en|Jan Smuts|711517191}}
  61. Heritage_Foundation {{Překlad|en|The Heritage Foundation|723858589}}
  62. Start_Linuxového_systému {{Překlad|en|Linux startup process|725173832}}
  63. urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
  64. $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement