Mercurial > moin > 1.9
changeset 1986:3475126f78c6
fix some builtin names used as attribute names
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Mon, 09 Apr 2007 22:06:09 +0200 |
parents | ecae6138ee1b |
children | 07aff6369476 |
files | MoinMoin/action/AttachFile.py MoinMoin/logfile/__init__.py MoinMoin/request/__init__.py MoinMoin/search/results.py MoinMoin/server/STANDALONE.py MoinMoin/theme/classic.py MoinMoin/user.py MoinMoin/util/pysupport.py MoinMoin/widget/browser.py MoinMoin/xmlrpc/HelloWorld.py |
diffstat | 10 files changed, 29 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/action/AttachFile.py Mon Apr 09 22:06:09 2007 +0200 @@ -412,13 +412,13 @@ scriptName = request.getScriptname() pagename_quoted = wikiutil.quoteWikinameURL(pagename) - for file in files: + for fname in files: url = "%s/%s?action=%s&do=view&target=%s" % ( scriptName, pagename_quoted, - action_name, wikiutil.url_quote_plus(file)) + action_name, wikiutil.url_quote_plus(fname)) request.write(u'<link rel="Appendix" title="%s" href="%s">\n' % ( - wikiutil.escape(file), wikiutil.escape(url))) + wikiutil.escape(fname), wikiutil.escape(url))) def send_hotdraw(pagename, request):
--- a/MoinMoin/logfile/__init__.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/logfile/__init__.py Mon Apr 09 22:06:09 2007 +0200 @@ -29,6 +29,9 @@ """ def __init__(self, file, offset, size, forward=True): """ + + TODO: when this gets refactored, don't use "file" (is a builtin) + @param file: open file object @param offset: position in file to start from @param size: aproximate number of bytes to read
--- a/MoinMoin/request/__init__.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/request/__init__.py Mon Apr 09 22:06:09 2007 +0200 @@ -755,14 +755,14 @@ def redirectedOutput(self, function, *args, **kw): """ Redirect output during function, return redirected output """ - buffer = StringIO.StringIO() - self.redirect(buffer) + buf = StringIO.StringIO() + self.redirect(buf) try: function(*args, **kw) finally: self.redirect() - text = buffer.getvalue() - buffer.close() + text = buf.getvalue() + buf.close() return text def redirect(self, file=None):
--- a/MoinMoin/search/results.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/search/results.py Mon Apr 09 22:06:09 2007 +0200 @@ -311,16 +311,16 @@ f = formatter write = self.buffer.write if numbered: - list = lambda on: f.number_list(on, start=hitsFrom+1) + lst = lambda on: f.number_list(on, start=hitsFrom+1) else: - list = f.bullet_list + lst = f.bullet_list if paging and len(self.hits) <= request.cfg.search_results_per_page: paging = False # Add pages formatted as list if self.hits: - write(list(1)) + write(lst(1)) if paging: hitsTo = hitsFrom + request.cfg.search_results_per_page @@ -356,7 +356,7 @@ f.listitem(0), ] write(''.join(item)) - write(list(0)) + write(lst(0)) if paging: write(self.formatPageLinks(hitsFrom=hitsFrom, hitsPerPage=request.cfg.search_results_per_page,
--- a/MoinMoin/server/STANDALONE.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/server/STANDALONE.py Mon Apr 09 22:06:09 2007 +0200 @@ -346,9 +346,9 @@ Components that mean special things to the local file system (e.g. drive or directory names) are ignored. """ - file = wikiutil.url_unquote(uri, want_unicode=False) - file.replace('\\', '/') - words = file.split('/') + path = wikiutil.url_unquote(uri, want_unicode=False) + path = path.replace('\\', '/') + words = path.split('/') words = filter(None, words) path = self.server.htdocs
--- a/MoinMoin/theme/classic.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/theme/classic.py Mon Apr 09 22:06:09 2007 +0200 @@ -89,7 +89,7 @@ @rtype: string @return: page header html """ - dict = { + newdict = { 'config_header1_html': self.emit_custom_html(self.cfg.page_header1), 'config_header2_html': self.emit_custom_html(self.cfg.page_header2), 'search_form_html': self.searchform(d), @@ -103,7 +103,7 @@ 'trail_html': self.trail(d), 'startpage_html': self.startPage(), } - dict.update(d) + newdict.update(d) html = """ %(config_header1_html)s @@ -125,7 +125,7 @@ %(config_header2_html)s %(startpage_html)s -""" % dict +""" % newdict return html def editorheader(self, d):
--- a/MoinMoin/user.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/user.py Mon Apr 09 22:06:09 2007 +0200 @@ -240,6 +240,8 @@ def __init__(self, request, id=None, name="", password=None, auth_username="", **kw): """ Initialize User object + TODO: when this gets refactored, use "uid" not builtin "id" + @param request: the request object @param id: (optional) user ID @param name: (optional) user name
--- a/MoinMoin/util/pysupport.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/util/pysupport.py Mon Apr 09 22:06:09 2007 +0200 @@ -36,8 +36,8 @@ if not in_plugin_dir(packagedir) and hasattr(moinmodule, '__loader__'): pyre = re.compile(r"^([^_].*)\.py(?:c|o)$") zipfiles = moinmodule.__loader__._files - dirlist = [file[0].replace(r'/', '\\').split('\\')[-1] - for file in zipfiles.values() if packagedir in file[0]] + dirlist = [entry[0].replace(r'/', '\\').split('\\')[-1] + for entry in zipfiles.values() if packagedir in entry[0]] else: pyre = re.compile(r"^([^_].*)\.py$") dirlist = os.listdir(packagedir)
--- a/MoinMoin/widget/browser.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/widget/browser.py Mon Apr 09 22:06:09 2007 +0200 @@ -76,9 +76,9 @@ # fill in the empty field we left blank unique[1] = self._empty - sorted = unique[3:] - sorted.sort() - unique = unique[:3] + sorted + sortedlist = unique[3:] + sortedlist.sort() + unique = unique[:3] + sortedlist return '\n'.join([self._makeoption(item, item == value) for item in unique]) def format(self):
--- a/MoinMoin/xmlrpc/HelloWorld.py Mon Apr 09 07:38:09 2007 +0000 +++ b/MoinMoin/xmlrpc/HelloWorld.py Mon Apr 09 22:06:09 2007 +0200 @@ -7,6 +7,6 @@ """ def execute(xmlrpcobj, *args): - str = args[0] - return xmlrpcobj._outstr("Hello World!\n" + str) + text = args[0] + return xmlrpcobj._outstr("Hello World!\n" + text)