bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Bloodhound" <bloodhound-...@incubator.apache.org>
Subject Re: [Apache Bloodhound] #88: Generic conversions of tables to bootstrap
Date Wed, 30 May 2012 04:17:09 GMT
#88: Generic conversions of tables to bootstrap
--------------------------+-----------------
  Reporter:  gjm          |      Owner:  gjm
      Type:  enhancement  |     Status:  new
  Priority:  major        |  Milestone:
 Component:  dashboard    |    Version:
Resolution:               |   Keywords:
--------------------------+-----------------

Comment (by olemis):

 Replying to [comment:9 gjm]:
 > r1343821 provides a mechanism to filter genshi streams to add css
 classes
 >
 > r1343847 adds the conversion for tables
 >

 cool !
 ''':)'''

 > If I haven't missed anything obvious, I would like to suggest the
 following as being a little more obvious about what it is doing.
 >
 > {{{
 > #!python
 >     def attr_modifier(name, event):
 >         attrs = event[1][1]
 >         class_list = attrs.get(name, '').split()
 >         self.log.debug('BH Theme : Element classes ' + str(class_list))
 >
 >         class_list += classes
 >         class_list = sorted(set(class_list))
 >         out_classes = ' '.join(class_list)
 >         self.log.debug('BH Theme : Inserting class ' + out_classes)
 >         return out_classes
 >     return attr_modifier
 > }}}

 hmmm ... initially I suggest to keep the (''spirit of'' the) following
 snippet in the patch (lines 125 , 126 in
 [attachment:t88_r1342840_bootstrap_css_filter.diff submitted patch])

 {{{
 #!python

 _classes = ' '.join(c for c in _classes if c in classet and not
 classet.discard(c))

 }}}

 Fact is that the goal is to introduce potentially new classes in the same
 order they were before being processed by stream filter . Order matters
 when browsers apply CSS to elements in a web page . Hence there's a chance
 (i.e. not always but possible ''';)''' for introducing odd behaviors in
 case order might be important in a particular situation . Set object is
 used in order to remove duplicates . The perfect solution is to use an
 ordered set ... but I don't know if there's one such thing anywhere out
 there for ''python'' development ... and we can use it for this .

 Names and everything else are ok afaict .

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/88#comment:10>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker

Mime
View raw message