SimObject.py (7500:b543b8e5fcbc) | SimObject.py (7525:722f2ad014a7) |
---|---|
1# Copyright (c) 2004-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 609 unchanged lines hidden (view full) --- 618 width = int(math.ceil(math.log(len(value))/math.log(10))) 619 for i,v in enumerate(value): 620 v._maybe_set_parent(self, "%s%0*d" % (attr, width, i)) 621 622 self._values[attr] = value 623 624 def path(self): 625 if not self._parent: | 1# Copyright (c) 2004-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 609 unchanged lines hidden (view full) --- 618 width = int(math.ceil(math.log(len(value))/math.log(10))) 619 for i,v in enumerate(value): 620 v._maybe_set_parent(self, "%s%0*d" % (attr, width, i)) 621 622 self._values[attr] = value 623 624 def path(self): 625 if not self._parent: |
626 return 'root' | 626 return '(orphan)' |
627 ppath = self._parent.path() 628 if ppath == 'root': 629 return self._name 630 return ppath + "." + self._name 631 632 def __str__(self): 633 return self.path() 634 --- 271 unchanged lines hidden --- | 627 ppath = self._parent.path() 628 if ppath == 'root': 629 return self._name 630 return ppath + "." + self._name 631 632 def __str__(self): 633 return self.path() 634 --- 271 unchanged lines hidden --- |