Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/plugins/graphed.py

leo
Discussion topic

Back to topic list

CVS update: /leo/plugins/graphed.py

Author terry_n_brown
Full name Terry Brown
Date 2007-10-24 18:47:46 PDT
Message User: terry_n_brown
Date: 2007-10-24 18:47:46-0700
Log:
 
 trivial change using hasattr to guard against attribute error for use of
 gNodes that doesn't set x and y. And a comment on a failed attempt to
 preserve clones.

File Changes:

Directory: /leo/plugins/
========================

File [changed]: graphed.py
Url: http://leo.tigris.or​g/source/browse/leo/​plugins/graphed.py?r​1=1.3&r2=1.4
Delta lines: +9 -1
-------------------
--- graphed.py 2007-10-08 19:41:46-0700 1.3
+++ graphed.py 2007-10-24 18:47:44-0700 1.4
@@ -134,7 +134,8 @@
                     vnode.unknownAttributes = {}
                 vnode.unknownAttributes.update(
                     getattr(self.vnode, 'unknownAttributes', {}))
- if self.x != 0 or self.y != 0:
+ if (hasattr(self, 'x') and hasattr(self, 'y')
+ and self.x != 0 or self.y != 0):
             if not hasattr(nd,'unknownA​ttributes'): nd.unknownAttributes = {}
             nd.unknownAttributes​.setdefault('graphed​',{}).update(
                 {'x': self.x, 'y': self.y})
@@ -238,6 +239,13 @@
 
         def makeTree(pos, node0):
 
+ # This does not work, all nodes become clones and things
+ # get parsed more than once.
+ #
+ # t = None
+ # if hasattr(node0, 'vnode'):
+ # t = node0.vnode.t
+
             nd = pos.insertAsLastChild()
             nd.expand()
             nd.setDirty()

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/plugins/graphed.py terry_n_brown Terry Brown 2007-10-24 18:47:46 PDT
Messages per page: