http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9195
Revision: 9195 Author: jayvdb Date: 2011-04-24 04:23:12 +0000 (Sun, 24 Apr 2011) Log Message: ----------- Remove query.IsString
Modified Paths: -------------- trunk/pywikipedia/query.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/query.py =================================================================== --- trunk/pywikipedia/query.py 2011-04-24 04:18:06 UTC (rev 9194) +++ trunk/pywikipedia/query.py 2011-04-24 04:23:12 UTC (rev 9195) @@ -56,7 +56,7 @@ else: params[k] = unicode(ListToParam(v))
- elif not IsString(v): + elif not isinstance(v,basestring): params[k] = unicode(v) elif type(v) == unicode: params[k] = ToUtf8(v) @@ -249,7 +249,7 @@ """ if item is None: return [] - elif IsString(item): + elif isinstance(item,basestring): return [item] else: return item @@ -277,9 +277,6 @@ s = s.decode(wikipedia.config.console_encoding) return s
-def IsString(s): - return type( s ) in [str, unicode] - if __name__ == '__main__': """ Testing code for this module
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2011-04-24 04:18:06 UTC (rev 9194) +++ trunk/pywikipedia/wikipedia.py 2011-04-24 04:23:12 UTC (rev 9195) @@ -1848,7 +1848,7 @@ # Submit the prepared information try: response, data = query.GetData(params, self.site(), sysop=sysop, back_response = True) - if query.IsString(data): + if isinstance(data,basestring): raise KeyError except httplib.BadStatusLine, line: raise PageNotSaved('Bad status line: %s' % line.line)
pywikipedia-svn@lists.wikimedia.org