drtrigon | 24 May 2013 19:03
Picon
Favicon

SVN: [11578] trunk/pywikipedia

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11578

Revision: 11578
Author:   drtrigon
Date:     2013-05-24 17:03:42 +0000 (Fri, 24 May 2013)
Log Message:
-----------
bug fix; IOError: unrecognized data stream contents when reading image file
some minor code clean-up

Modified Paths:
--------------
    trunk/pywikipedia/catimages.py
    trunk/pywikipedia/externals/__init__.py

Modified: trunk/pywikipedia/catimages.py
===================================================================
--- trunk/pywikipedia/catimages.py	2013-05-24 16:25:09 UTC (rev 11577)
+++ trunk/pywikipedia/catimages.py	2013-05-24 17:03:42 UTC (rev 11578)
 <at>  <at>  -1305,7 +1305,7  <at>  <at> 
             img    = cv2.imread( self.image_path_JPEG, cv.CV_LOAD_IMAGE_COLOR )
             if (img == None) or (self.image_size[0] is None):
                 raise IOError
-            
+
             # !!! the 'scale' here IS RELEVANT FOR THE DETECTION RATE;
             # how small and how many features are detected
             scale  = max([1., np.average(np.array(img.shape)[0:2]/maxdim)])
 <at>  <at>  -1527,7 +1527,10  <at>  <at> 
             # Read a Data Matrix barcode
(Continue reading)

valhallasw | 24 May 2013 18:25
Picon
Favicon

SVN: [11577] branches/rewrite/generate_user_files.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11577

Revision: 11577
Author:   valhallasw
Date:     2013-05-24 16:25:09 +0000 (Fri, 24 May 2013)
Log Message:
-----------
actually use locals() instead of using %(username)s as username

Modified Paths:
--------------
    branches/rewrite/generate_user_files.py

Modified: branches/rewrite/generate_user_files.py
===================================================================
--- branches/rewrite/generate_user_files.py	2013-05-24 15:10:37 UTC (rev 11576)
+++ branches/rewrite/generate_user_files.py	2013-05-24 16:25:09 UTC (rev 11577)
 <at>  <at>  -217,7 +217,7  <at>  <at> 
         while(raw_input("Do you want to add any other projects? (y/N)").upper() == "Y"):
              fam, mylang, username = get_site_and_lang()
              username = username or mainusername
-             f.write("usernames['%(fam)s']['%(mylang)s'] = u'%(username)s'\n")
+             f.write("usernames['%(fam)s']['%(mylang)s'] = u'%(username)s'\n" % locals())

         f.close()
         print("'%s' written." % _fnc)

_______________________________________________
Pywikipedia-svn mailing list
Pywikipedia-svn <at> lists.wikimedia.org
(Continue reading)

valhallasw | 24 May 2013 17:10
Picon
Favicon

SVN: [11576] branches/rewrite/generate_user_files.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11576

Revision: 11576
Author:   valhallasw
Date:     2013-05-24 15:10:37 +0000 (Fri, 24 May 2013)
Log Message:
-----------
+ allow multiple users to be created in the user-config

Modified Paths:
--------------
    branches/rewrite/generate_user_files.py

Modified: branches/rewrite/generate_user_files.py
===================================================================
--- branches/rewrite/generate_user_files.py	2013-05-24 14:52:50 UTC (rev 11575)
+++ branches/rewrite/generate_user_files.py	2013-05-24 15:10:37 UTC (rev 11576)
 <at>  <at>  -133,22 +133,29  <at>  <at> 
         return True
     return False

-def create_user_config():
-    _fnc = os.path.join(base_dir, "user-config.py")
-    if not file_exists(_fnc):
+def get_site_and_lang():
         known_families = re.findall(r'(.+)_family.py\b',
                                    '\n'.join(os.listdir(
                                        os.path.join(pywikibot_dir,
                                                     "pywikibot",
                                                     "families"))))
(Continue reading)

valhallasw | 24 May 2013 16:52
Picon
Favicon

SVN: [11575] branches/rewrite/pwb.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11575

Revision: 11575
Author:   valhallasw
Date:     2013-05-24 14:52:50 +0000 (Fri, 24 May 2013)
Log Message:
-----------
+ auto-generate user files if they do not exist yet

Modified Paths:
--------------
    branches/rewrite/pwb.py

Modified: branches/rewrite/pwb.py
===================================================================
--- branches/rewrite/pwb.py	2013-05-24 08:29:32 UTC (rev 11574)
+++ branches/rewrite/pwb.py	2013-05-24 14:52:50 UTC (rev 11575)
 <at>  <at>  -31,6 +31,9  <at>  <at> 
 if "PYWIKIBOT2_DIR" not in os.environ:
     os.environ["PYWIKIBOT2_DIR"] = os.path.split(__file__)[0]

+if not os.path.exists(os.path.join(os.environ["PYWIKIBOT2_DIR"], "user-config.py")):
+    execfile('generate_user_files.py')
+
 sys.argv.pop(0)
 if len(sys.argv) > 0:
     if not os.path.exists(sys.argv[0]):

_______________________________________________
Pywikipedia-svn mailing list
(Continue reading)

amir | 24 May 2013 10:29
Picon
Favicon

SVN: [11574] trunk/pywikipedia

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11574

Revision: 11574
Author:   amir
Date:     2013-05-24 08:29:32 +0000 (Fri, 24 May 2013)
Log Message:
-----------
Adding harvset_template from rewrite branch with some setting special for trunk. I tested it and It worked

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Added Paths:
-----------
    trunk/pywikipedia/harvest_template.py

Added: trunk/pywikipedia/harvest_template.py
===================================================================
--- trunk/pywikipedia/harvest_template.py	                        (rev 0)
+++ trunk/pywikipedia/harvest_template.py	2013-05-24 08:29:32 UTC (rev 11574)
 <at>  <at>  -0,0 +1,157  <at>  <at> 
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+Copyright (C) 2013 Multichill, Amir
+Copyright (C) 2013 Pywikipediabot team
+
+Distributed under the MIT License
+
(Continue reading)

amir | 24 May 2013 10:00
Picon
Favicon

SVN: [11573] branches/rewrite/scripts/harvest_template.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11573

Revision: 11573
Author:   amir
Date:     2013-05-24 08:00:04 +0000 (Fri, 24 May 2013)
Log Message:
-----------
Adding Persian Wikipedia

Modified Paths:
--------------
    branches/rewrite/scripts/harvest_template.py

Modified: branches/rewrite/scripts/harvest_template.py
===================================================================
--- branches/rewrite/scripts/harvest_template.py	2013-05-24 07:15:36 UTC (rev 11572)
+++ branches/rewrite/scripts/harvest_template.py	2013-05-24 08:00:04 UTC (rev 11573)
 <at>  <at>  -50,6 +50,7  <at>  <at> 
                          'de': pywikibot.ItemPage(self.repo, 'Q48183'),
                          'it': pywikibot.ItemPage(self.repo, 'Q11920'),
                          'no': pywikibot.ItemPage(self.repo, 'Q191769'),
+                         'fa': pywikibot.ItemPage(self.repo, 'Q48952'),
                          'ar': pywikibot.ItemPage(self.repo, 'Q199700'),
                          'es': pywikibot.ItemPage(self.repo, 'Q8449'),
                          'pl': pywikibot.ItemPage(self.repo, 'Q1551807'),

_______________________________________________
Pywikipedia-svn mailing list
Pywikipedia-svn <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn
(Continue reading)

valhallasw | 24 May 2013 09:15
Picon
Favicon

SVN: [11572] trunk/pywikipedia/flickrripper.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11572

Revision: 11572
Author:   valhallasw
Date:     2013-05-24 07:15:36 +0000 (Fri, 24 May 2013)
Log Message:
-----------
Flickrripper: strip _ around filenames. Patch by David E. Narv?\195?\161ez ( dmaggot )

Modified Paths:
--------------
    trunk/pywikipedia/flickrripper.py

Modified: trunk/pywikipedia/flickrripper.py
===================================================================
--- trunk/pywikipedia/flickrripper.py	2013-05-20 12:20:18 UTC (rev 11571)
+++ trunk/pywikipedia/flickrripper.py	2013-05-24 07:15:36 UTC (rev 11572)
 <at>  <at>  -203,6 +203,7  <at>  <at> 
     title = re.sub(u",,+", u",", title)
     title = re.sub(u"[-,^]([.]|$)", u"\\1", title)
     title = title.replace(u" ", u"_")
+    title = title.strip(u"_")
     return title

_______________________________________________
Pywikipedia-svn mailing list
Pywikipedia-svn <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn
xqt | 20 May 2013 14:20
Picon
Favicon

SVN: [11571] trunk/pywikipedia/templatecount.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11571

Revision: 11571
Author:   xqt
Date:     2013-05-20 12:20:18 +0000 (Mon, 20 May 2013)
Log Message:
-----------
fix for generator

Modified Paths:
--------------
    trunk/pywikipedia/templatecount.py

Modified: trunk/pywikipedia/templatecount.py
===================================================================
--- trunk/pywikipedia/templatecount.py	2013-05-20 11:59:06 UTC (rev 11570)
+++ trunk/pywikipedia/templatecount.py	2013-05-20 12:20:18 UTC (rev 11571)
 <at>  <at>  -30,7 +30,8  <at>  <at> 

 """
 #
-# (C) Pywikipedia bot team, 2006-2013
+# (c) Pywikipedia bot team, 2006-2012
+# (c) xqt, 2009-2013
 #
 # Distributed under the terms of the MIT license.
 #
 <at>  <at>  -47,8 +48,7  <at>  <at> 

      <at> staticmethod
(Continue reading)

xqt | 20 May 2013 13:59
Picon
Favicon

SVN: [11570] trunk/pywikipedia/templatecount.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11570

Revision: 11570
Author:   xqt
Date:     2013-05-20 11:59:06 +0000 (Mon, 20 May 2013)
Log Message:
-----------
we also have a generator now

Modified Paths:
--------------
    trunk/pywikipedia/templatecount.py

Modified: trunk/pywikipedia/templatecount.py
===================================================================
--- trunk/pywikipedia/templatecount.py	2013-05-20 11:57:43 UTC (rev 11569)
+++ trunk/pywikipedia/templatecount.py	2013-05-20 11:59:06 UTC (rev 11570)
 <at>  <at>  -65,11 +65,10  <at>  <at> 

      <at> staticmethod
     def listTemplates(templates, namespaces):
-        templateDict = TemplateCountRobot.generate_template_dict(templates,
-                                                                 namespaces)
+        templateDict = TemplateCountRobot.template_dict(templates, namespaces)
         pywikibot.output(u'\nList of pages transcluding templates:',
                          toStdout=True)
-        for key in templateDict:
+        for key in templates:
             pywikibot.output(u'* %s' % key)
         pywikibot.output(u'-' * 36, toStdout=True)
(Continue reading)

siebrand | 20 May 2013 13:57
Picon
Favicon

SVN: [11569] branches/rewrite/scripts/i18n

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11569

Revision: 11569
Author:   siebrand
Date:     2013-05-20 11:57:43 +0000 (Mon, 20 May 2013)
Log Message:
-----------
Localisation updates from http://translatewiki.net.

Modified Paths:
--------------
    branches/rewrite/scripts/i18n/pywikibot.py
    branches/rewrite/scripts/i18n/redirect.py
    branches/rewrite/scripts/i18n/weblinkchecker.py

Modified: branches/rewrite/scripts/i18n/pywikibot.py
===================================================================
--- branches/rewrite/scripts/i18n/pywikibot.py	2013-05-20 11:30:52 UTC (rev 11568)
+++ branches/rewrite/scripts/i18n/pywikibot.py	2013-05-20 11:57:43 UTC (rev 11569)
 <at>  <at>  -285,7 +285,7  <at>  <at> 
 	'he': {
 		'pywikibot-enter-xml-filename': u'נא להזין את שם קובץ ה־XML עם הדאמפ:',
 		'pywikibot-enter-page-processing': u'איזה דף יש לעבד?',
-		'pywikibot-enter-file-links-processing': u'קישורים לאיזה דף תמונה יש לעבד?',
+		'pywikibot-enter-file-links-processing': u'קישורים לאיזה דף קובץ יש לעבד?',
 		'pywikibot-enter-namespace-number': u'נא להזין את שם מרחב השם לפי
המספר שלו:',
 		'pywikibot-enter-new-text': u'נא להזין את הטקסט החדש:',
 		'pywikibot-enter-category-name': u'נא להזין את שם הקטגוריה:',
 <at>  <at>  -293,10 +293,11  <at>  <at> 
(Continue reading)

xqt | 20 May 2013 13:30
Picon
Favicon

SVN: [11568] trunk/pywikipedia/templatecount.py

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11568

Revision: 11568
Author:   xqt
Date:     2013-05-20 11:30:52 +0000 (Mon, 20 May 2013)
Log Message:
-----------
simplify and recycle code

Modified Paths:
--------------
    trunk/pywikipedia/templatecount.py

Modified: trunk/pywikipedia/templatecount.py
===================================================================
--- trunk/pywikipedia/templatecount.py	2013-05-20 11:02:12 UTC (rev 11567)
+++ trunk/pywikipedia/templatecount.py	2013-05-20 11:30:52 UTC (rev 11568)
 <at>  <at>  -30,7 +30,7  <at>  <at> 

 """
 #
-# (C) Pywikipedia bot team, 2006-2012
+# (C) Pywikipedia bot team, 2006-2013
 #
 # Distributed under the terms of the MIT license.
 #
 <at>  <at>  -47,52 +47,49  <at>  <at> 

      <at> staticmethod
     def countTemplates(templates, namespaces):
(Continue reading)


Gmane