[Pywikipedia-l] SVN: [6249] trunk/pywikipedia/wikipedia.py

russblau at svn.wikimedia.org russblau at svn.wikimedia.org
Mon Jan 12 13:44:28 UTC 2009


Revision: 6249
Author:   russblau
Date:     2009-01-12 13:44:28 +0000 (Mon, 12 Jan 2009)

Log Message:
-----------
handleArgs() bug and aslink() formatting

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

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2009-01-10 23:14:13 UTC (rev 6248)
+++ trunk/pywikipedia/wikipedia.py	2009-01-12 13:44:28 UTC (rev 6249)
@@ -586,12 +586,13 @@
         if not noInterwiki and (forceInterwiki or self.site() != getSite()):
             if self.site().family != getSite().family \
                     and self.site().family.name != self.site().lang:
-                return u'[[%s:%s:%s]]' % (self.site().family.name,
-                                          self.site().lang,
-                                          self.title(savetitle=True,decode=True))
+                return u'[[:%s:%s:%s]]' % (self.site().family.name,
+                                           self.site().lang,
+                                           self.title(savetitle=True,
+                                                      decode=True))
             else:
-                return u'[[%s:%s]]' % (self.site().lang,
-                                       self.title(savetitle=True,decode=True))
+                return u'[[:%s:%s]]' % (self.site().lang,
+                                        self.title(savetitle=True, decode=True))
         elif textlink and (self.isImage() or self.isCategory()):
                 return u'[[:%s]]' % self.title(savetitle=True, decode=True)
         else:
@@ -6194,14 +6195,14 @@
     global default_code, default_family, verbose
     # get commandline arguments
     if not args:
-        args = sys.argv
+        args = sys.argv[1:]
     # get the name of the module calling this function. This is
     # required because the -help option loads the module's docstring and because
     # the module name will be used for the filename of the log.
     # TODO: check if the following line is platform-independent
     moduleName = calledModuleName()
     nonGlobalArgs = []
-    for arg in args[1:]:
+    for arg in args:
         arg = decodeArg(arg)
         if arg == '-help':
             showHelp(moduleName)





More information about the Pywikipedia-l mailing list