22"""
33
44todo = '''
5- - Most methods should have a "default" arg to supply a value
6- when none appears in the hyperdb or request.
5+ - Most methods should have a "default" arg to supply a value
6+ when none appears in the hyperdb or request.
77- Multilink property additions: change_note and new_upload
88- Add class.find() too
99- NumberHTMLProperty should support numeric operations
@@ -175,7 +175,7 @@ class RoundupPageTemplate(PageTemplate.PageTemplate):
175175
176176 - the url
177177 - the current index information (``filterspec``, ``filter`` args,
178- ``properties``, etc) parsed out of the form.
178+ ``properties``, etc) parsed out of the form.
179179 - methods for easy filterspec link generation
180180 - *user*, the current user node as an HTMLItem instance
181181 - *form*, the current CGI form information as a FieldStorage
@@ -550,7 +550,7 @@ def classhelp(self, properties=None, label='(list)', width='500',
550550 height = '400' , property = '' ):
551551 ''' Pop up a javascript window with class help
552552
553- This generates a link to a popup window which displays the
553+ This generates a link to a popup window which displays the
554554 properties indicated by "properties" of the class named by
555555 "classname". The "properties" should be a comma-separated list
556556 (eg. 'id,name,description'). Properties defaults to all the
@@ -665,7 +665,7 @@ def designator(self):
665665 def is_retired (self ):
666666 """Is this item retired?"""
667667 return self ._klass .is_retired (self ._nodeid )
668-
668+
669669 def submit (self , label = "Submit Changes" ):
670670 """Generate a submit button.
671671
@@ -722,7 +722,7 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
722722 id = self ._klass .get (self ._nodeid , prop_n , None )
723723 current [prop_n ] = '<a href="%s%s">%s</a>' % (
724724 classname , id , current [prop_n ])
725-
725+
726726 for id , evt_date , user , action , args in history :
727727 date_s = str (evt_date .local (timezone )).replace ("." ," " )
728728 arg_s = ''
@@ -753,8 +753,8 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
753753 prop = None
754754 if prop is None :
755755 # property no longer exists
756- comments ['no_exist' ] = _ ('''<em>The indicated property
757- no longer exists</em>''' )
756+ comments ['no_exist' ] = _ (
757+ "<em>The indicated property no longer exists</em>" )
758758 cell .append ('<em>%s: %s</em>\n ' % (k , str (args [k ])))
759759 continue
760760
@@ -766,8 +766,9 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
766766 linkcl = self ._db .getclass (classname )
767767 except KeyError :
768768 labelprop = None
769- comments [classname ] = _ ('''The linked class
770- %(classname)s no longer exists''' )% locals ()
769+ comments [classname ] = _ (
770+ "The linked class %(classname)s no longer exists"
771+ ) % locals ()
771772 labelprop = linkcl .labelprop (1 )
772773 try :
773774 template = find_template (self ._db .config .TEMPLATES ,
@@ -798,9 +799,9 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
798799 labelprop != 'id' :
799800 label = linkcl .get (linkid , labelprop )
800801 except IndexError :
801- comments ['no_link' ] = _ ('''<strike>The
802- linked node no longer
803- exists</strike>''' )
802+ comments ['no_link' ] = _ (
803+ "<strike>The linked node"
804+ " no longer exists</strike>" )
804805 subml .append ('<strike>%s</strike>' % label )
805806 else :
806807 if hrefable :
@@ -819,9 +820,9 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
819820 try :
820821 label = linkcl .get (args [k ], labelprop )
821822 except IndexError :
822- comments ['no_link' ] = _ ('''<strike>The
823- linked node no longer
824- exists</strike>''' )
823+ comments ['no_link' ] = _ (
824+ "<strike>The linked node"
825+ " no longer exists</strike>" )
825826 cell .append (' <strike>%s</strike>,\n ' % label )
826827 # "flag" this is done .... euwww
827828 label = None
@@ -879,8 +880,8 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
879880 arg_s = '<br />' .join (cell )
880881 else :
881882 # unkown event!!
882- comments ['unknown' ] = _ (''' <strong><em>This event is not
883- handled by the history display!</em></strong>''' )
883+ comments ['unknown' ] = _ (" <strong><em>This event is not handled"
884+ " by the history display!</em></strong>" )
884885 arg_s = '<strong><em>' + str (args ) + '</em></strong>'
885886 date_s = date_s .replace (' ' , ' ' )
886887 # if the user's an itemid, figure the username (older journals
@@ -1071,7 +1072,7 @@ def hyperlinked(self):
10711072
10721073 def plain (self , escape = 0 , hyperlink = 0 ):
10731074 '''Render a "plain" representation of the property
1074-
1075+
10751076 - "escape" turns on/off HTML quoting
10761077 - "hyperlink" turns on/off in-text hyperlinking of URLs, email
10771078 addresses and designators
@@ -1183,7 +1184,7 @@ def field(self, size = 30):
11831184 return self .plain ()
11841185
11851186 def confirm (self , size = 30 ):
1186- ''' Render a second form edit field for the property, used for
1187+ ''' Render a second form edit field for the property, used for
11871188 confirmation that the user typed the password correctly. Generates
11881189 a field with name "@confirm@name".
11891190
@@ -1316,7 +1317,7 @@ def field(self, size = 30):
13161317 if self .is_edit_ok ():
13171318 value = '"' .join (value .split ('"' ))
13181319 return self .input (name = self ._formname ,value = value ,size = size )
1319-
1320+
13201321 return self .plain ()
13211322
13221323 def reldate (self , pretty = 1 ):
@@ -1482,9 +1483,9 @@ def menu(self, size=None, height=None, showid=0, additional=[],
14821483 if value is None :
14831484 s = 'selected="selected" '
14841485 l .append (_ ('<option %svalue="-1">- no selection -</option>' )% s )
1485- if linkcl .getprops ().has_key ('order' ):
1486+ if linkcl .getprops ().has_key ('order' ):
14861487 sort_on = ('+' , 'order' )
1487- else :
1488+ else :
14881489 if sort_on is None :
14891490 sort_on = ('+' , linkcl .labelprop ())
14901491 else :
@@ -1539,7 +1540,7 @@ def __init__(self, *args, **kwargs):
15391540 fail_ok = 1 )
15401541 sortfun = make_sort_function (self ._db , self ._prop .classname )
15411542 self ._value .sort (sortfun )
1542-
1543+
15431544 def __len__ (self ):
15441545 ''' length of the multilink '''
15451546 return len (self ._value )
@@ -1854,7 +1855,7 @@ def _post_init(self):
18541855 def updateFromURL (self , url ):
18551856 ''' Parse the URL for query args, and update my attributes using the
18561857 values.
1857- '''
1858+ '''
18581859 env = {'QUERY_STRING' : url }
18591860 self .form = cgi .FieldStorage (environ = env )
18601861
@@ -2072,7 +2073,7 @@ def __getitem__(self, index):
20722073 if index < 0 :
20732074 if index + self .end < self .first : raise IndexError , index
20742075 return self ._sequence [index + self .end ]
2075-
2076+
20762077 if index >= self .length :
20772078 raise IndexError , index
20782079
0 commit comments