htmlgen lacks of a few Ids

Bug #157373 reported by Fred Baumgarten
4
Affects Status Importance Assigned to Milestone
htmlgen (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: python-htmlgen

The classes Input and Select don't support the 'ID' tag.

Here is a patch to fix it, please file this to the upstream maintainer for further releases.

Thanks in Advance,
Fred

*** HTMLgen.py.orig 2007-10-26 11:26:53.000000000 +0200
--- HTMLgen.py 2007-10-26 11:26:49.000000000 +0200
***************
*** 1262,1267 ****
--- 1262,1268 ----
          type -- 'TEXT' (default) Supported types include password, checkbox,
                        radio, file, submit, reset, hidden.
          name -- provides the datum name
+ id -- global identifier
          value -- the initial value of the input item
          checked -- flag indicating if the item is checked initially
          size -- size of the widget (e.g. size=10 for a text widget is it's width)
***************
*** 1286,1291 ****
--- 1287,1293 ----
      def __init__(self, **kw):
          self.type = 'TEXT'
          self.name = 'Default_Name'
+ self.id = None
          self.value = None
          self.checked = ''
          self.size = 0
***************
*** 1313,1318 ****
--- 1315,1321 ----
          s.append('\n<INPUT')
          if self.type: s.append(' TYPE="%s"' % self.type)
          if self.name: s.append(' NAME="%s"' % self.name)
+ if self.id is not None: s.append(' ID="%s"' % self.id)
          if self.value is not None: s.append(' VALUE="%s"' % self.value)
          if self.checked: s.append(' CHECKED')
          if self.size: s.append(' SIZE=%s' % self.size)
***************
*** 1340,1345 ****
--- 1343,1349 ----
      Keyword Arguments:

          name -- provides the datum name
+ id -- global identifier
          size -- the visual size. 1 means use an option popup widget.
                                 >=2 means use a list widget with that many lines.
          multiple -- flag to indicate whether multiple selections are supported.
***************
*** 1351,1356 ****
--- 1355,1361 ----
      def __init__(self, data=None, **kw):
          UserList.UserList.__init__(self, data)
          self.name = ''
+ self.id = None
          self.size = 1
          self.multiple = None
          self.selected = []
***************
*** 1366,1371 ****
--- 1371,1377 ----
      def __str__(self):
          s = ['<SELECT NAME="%s"' % self.name]
          if self.size: s.append(' SIZE=%s' % self.size)
+ if self.id is not None: s.append(' ID="%s"' % self.id)
          if self.multiple: s.append(' MULTIPLE')
          if self.onBlur: s.append(' onBlur="%s"' % self.onBlur)
          if self.onChange: s.append(' onChange="%s"' % self.onChange)

Related branches

Revision history for this message
Fred Baumgarten (dc6iq) wrote :

ok, patch applied...

Morten Kjeldgaard (mok0)
Changed in htmlgen:
importance: Undecided → Wishlist
status: New → Fix Committed
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

Attached please find a debdiff incorporating the fix in the previous comment, plus the issue in bug #172800. Here's the debian/changelog entry:

htmlgen (2.2.2-12ubuntu1) hardy; urgency=low

  * Patched to make Input and Select classes support the 'ID' tag
    (LP: #157373).
  * Patched to replace use of whrandom, which is not in Python2.5,
    with the random module (LP: #172800).
  * debian/control:
    - build depend on quilt.
    - Ubuntu maintainer munge
  * debian/rules: introduce quilt.

 -- Morten Kjeldgaard <email address hidden> Tue, 08 Apr 2008 17:34:36 +0200

Morten Kjeldgaard (mok0)
Changed in htmlgen:
status: Fix Committed → Confirmed
Revision history for this message
Daniel Holbach (dholbach) wrote :

./htmlgen_patch looks like a leftover file.

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

You are right. Here's another debdiff without it.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Minor things:

This looks unnecessary:
-# from whrandom import randint
+ from random import randint

and I wouldn't have introduced a patch system for these two patches (needs to get merged if the changes don't go upstream), other than that: good work! Who takes care of forwardin the changes upstream?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package htmlgen - 2.2.2-12ubuntu1

---------------
htmlgen (2.2.2-12ubuntu1) hardy; urgency=low

  * Patched to make Input and Select classes support the 'ID' tag
    (LP: #157373).
  * Patched to replace use of whrandom, which is not in Python2.5,
    with the random module (LP: #172800).
  * debian/control:
    - build depend on quilt.
    - Ubuntu maintainer munge
  * debian/rules: introduce quilt.

 -- Morten Kjeldgaard <email address hidden> Tue, 08 Apr 2008 17:34:36 +0200

Changed in htmlgen:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.