Changeset 1553d27
- Timestamp:
- Nov 12, 2010 8:46:13 AM (14 years ago)
- Branches:
- version-3.02
- Parents:
- d608a90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/topdl.py
rd608a90 r1553d27 532 532 533 533 class Topology(base): 534 version = "1.0" 534 535 @staticmethod 535 536 def init_element(e): … … 554 555 return e 555 556 556 def __init__(self, substrates=[], elements=[], attribute=[]): 557 def __init__(self, substrates=[], elements=[], attribute=[], 558 version=None): 559 560 if version is None: self.version = Topology.version 561 else: self.version = version 562 557 563 self.substrates = [ self.init_class(Substrate, s) \ 558 564 for s in self.make_list(substrates) ] … … 619 625 return Topology(substrates=[s.clone() for s in self.substrates], 620 626 elements=[e.clone() for e in self.elements], 621 attribute=[a.clone() for a in self.attribute]) 627 attribute=[a.clone() for a in self.attribute], 628 version=self.version) 622 629 623 630 … … 628 635 def to_dict(self): 629 636 rv = { } 637 rv['version'] = self.version 630 638 if self.substrates: 631 639 rv['substrates'] = [ s.to_dict() for s in self.substrates ] … … 637 645 638 646 def to_xml(self): 639 rv = " "647 rv = "<version>%s</version>" % escape(self.version) 640 648 if self.substrates: 641 649 rv += join(["<substrates>%s</substrates>" % s.to_xml() \
Note: See TracChangeset
for help on using the changeset viewer.