/[papo]/papo/ruff/box.py
ViewVC logotype

Diff of /papo/ruff/box.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jlenton, Tue Nov 25 14:35:32 2003 UTC revision 1.5 by jlenton, Wed Nov 26 19:38:02 2003 UTC
# Line 19  Line 19 
19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20    
21  from UserList import UserList  from UserList import UserList
   
22  from errors import *  from errors import *
23    
24  __all__ = ("Box",)  __all__ = ("Box",)
# Line 30  Center = 0 Line 29  Center = 0
29    
30  class Box(UserList):  class Box(UserList):
31      def __init__(self, *args, **kw):      def __init__(self, *args, **kw):
32          for i in ('parent', 'line', 'column', 'width', 'height', 'align', 'vfill', 'raw', 'wrap'):          for i in ('parent', 'line', 'column', 'width', 'height', 'align', 'vfill', 'raw', 'wrap', 'style'):
             #print "%s: %s" % (i, kw[i])  
33              setattr(self, i, kw[i])              setattr(self, i, kw[i])
34          self.encoder = self.parent.encoder          self.encoder = self.parent.encoder
35            self.caps = self.parent.root.caps
36          self(*args)          self(*args)
37    
38      def reset(self):      def reset(self):
# Line 85  class Box(UserList): Line 84  class Box(UserList):
84              s=[s]              s=[s]
85          if container_height and self.vfill:          if container_height and self.vfill:
86              s = (s*container_height)[:container_height]              s = (s*container_height)[:container_height]
87          return s          i=self.caps.start(self.style)
88            o=self.caps.end(self.style)
89            return [i+j+o for j in s]
90    
91  if __name__ == '__main__':  if __name__ == '__main__':
92      d=Box('hola', 'que', 'tal', 'los chicos bien la familia bien',      d=Box('hola', 'que', 'tal', 'los chicos bien la familia bien',

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26