Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 2327:36ae1b14aaab
remove excessive spaces in the translatable strings;
trim trailing spaces in code
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Tue, 18 May 2004 19:23:44 +0000 |
| parents | da4444e593f4 |
| children | fbbda3b1816d |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Tue May 18 19:20:47 2004 +0000 +++ b/roundup/cgi/templating.py Tue May 18 19:23:44 2004 +0000 @@ -2,8 +2,8 @@ """ todo = ''' -- Most methods should have a "default" arg to supply a value - when none appears in the hyperdb or request. +- Most methods should have a "default" arg to supply a value + when none appears in the hyperdb or request. - Multilink property additions: change_note and new_upload - Add class.find() too - NumberHTMLProperty should support numeric operations @@ -175,7 +175,7 @@ - the url - the current index information (``filterspec``, ``filter`` args, - ``properties``, etc) parsed out of the form. + ``properties``, etc) parsed out of the form. - methods for easy filterspec link generation - *user*, the current user node as an HTMLItem instance - *form*, the current CGI form information as a FieldStorage @@ -550,7 +550,7 @@ height='400', property=''): ''' Pop up a javascript window with class help - This generates a link to a popup window which displays the + This generates a link to a popup window which displays the properties indicated by "properties" of the class named by "classname". The "properties" should be a comma-separated list (eg. 'id,name,description'). Properties defaults to all the @@ -665,7 +665,7 @@ def is_retired(self): """Is this item retired?""" return self._klass.is_retired(self._nodeid) - + def submit(self, label="Submit Changes"): """Generate a submit button. @@ -722,7 +722,7 @@ id = self._klass.get(self._nodeid, prop_n, None) current[prop_n] = '<a href="%s%s">%s</a>'%( classname, id, current[prop_n]) - + for id, evt_date, user, action, args in history: date_s = str(evt_date.local(timezone)).replace("."," ") arg_s = '' @@ -753,8 +753,8 @@ prop = None if prop is None: # property no longer exists - comments['no_exist'] = _('''<em>The indicated property - no longer exists</em>''') + comments['no_exist'] = _( + "<em>The indicated property no longer exists</em>") cell.append('<em>%s: %s</em>\n'%(k, str(args[k]))) continue @@ -766,8 +766,9 @@ linkcl = self._db.getclass(classname) except KeyError: labelprop = None - comments[classname] = _('''The linked class - %(classname)s no longer exists''')%locals() + comments[classname] = _( + "The linked class %(classname)s no longer exists" + ) % locals() labelprop = linkcl.labelprop(1) try: template = find_template(self._db.config.TEMPLATES, @@ -798,9 +799,9 @@ labelprop != 'id': label = linkcl.get(linkid, labelprop) except IndexError: - comments['no_link'] = _('''<strike>The - linked node no longer - exists</strike>''') + comments['no_link'] = _( + "<strike>The linked node" + " no longer exists</strike>") subml.append('<strike>%s</strike>'%label) else: if hrefable: @@ -819,9 +820,9 @@ try: label = linkcl.get(args[k], labelprop) except IndexError: - comments['no_link'] = _('''<strike>The - linked node no longer - exists</strike>''') + comments['no_link'] = _( + "<strike>The linked node" + " no longer exists</strike>") cell.append(' <strike>%s</strike>,\n'%label) # "flag" this is done .... euwww label = None @@ -879,8 +880,8 @@ arg_s = '<br />'.join(cell) else: # unkown event!! - comments['unknown'] = _('''<strong><em>This event is not - handled by the history display!</em></strong>''') + comments['unknown'] = _("<strong><em>This event is not handled" + " by the history display!</em></strong>") arg_s = '<strong><em>' + str(args) + '</em></strong>' date_s = date_s.replace(' ', ' ') # if the user's an itemid, figure the username (older journals @@ -1071,7 +1072,7 @@ def plain(self, escape=0, hyperlink=0): '''Render a "plain" representation of the property - + - "escape" turns on/off HTML quoting - "hyperlink" turns on/off in-text hyperlinking of URLs, email addresses and designators @@ -1183,7 +1184,7 @@ return self.plain() def confirm(self, size = 30): - ''' Render a second form edit field for the property, used for + ''' Render a second form edit field for the property, used for confirmation that the user typed the password correctly. Generates a field with name "@confirm@name". @@ -1316,7 +1317,7 @@ if self.is_edit_ok(): value = '"'.join(value.split('"')) return self.input(name=self._formname,value=value,size=size) - + return self.plain() def reldate(self, pretty=1): @@ -1482,9 +1483,9 @@ if value is None: s = 'selected="selected" ' l.append(_('<option %svalue="-1">- no selection -</option>')%s) - if linkcl.getprops().has_key('order'): + if linkcl.getprops().has_key('order'): sort_on = ('+', 'order') - else: + else: if sort_on is None: sort_on = ('+', linkcl.labelprop()) else: @@ -1539,7 +1540,7 @@ fail_ok=1) sortfun = make_sort_function(self._db, self._prop.classname) self._value.sort(sortfun) - + def __len__(self): ''' length of the multilink ''' return len(self._value) @@ -1854,7 +1855,7 @@ def updateFromURL(self, url): ''' Parse the URL for query args, and update my attributes using the values. - ''' + ''' env = {'QUERY_STRING': url} self.form = cgi.FieldStorage(environ=env) @@ -2072,7 +2073,7 @@ if index < 0: if index + self.end < self.first: raise IndexError, index return self._sequence[index + self.end] - + if index >= self.length: raise IndexError, index
