- Timestamp:
- May 25, 2010 11:05:21 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- d3c8759
- Parents:
- b53e1fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/topdl.py
rb53e1fc rda2208a 3 3 import re 4 4 import xml.parsers.expat 5 6 from fedid import fedid as fedid_class 5 7 6 8 class base: … … 60 62 class Attribute(base): 61 63 def __init__(self, attribute, value): 62 self.attribute = attribute63 self.value = value64 self.attribute = "%s" % attribute 65 self.value = "%s" % value 64 66 65 67 def clone(self): … … 72 74 def __init__(self, rate, kind): 73 75 self.rate = float(rate) 74 self.kind = kind76 self.kind = "%s" % kind 75 77 76 78 def clone(self): … … 83 85 def __init__(self, time, kind): 84 86 self.time = float(time) 85 self.kind = kind87 self.kind = "%s" % kind 86 88 87 89 def clone(self): … … 93 95 class Substrate(base): 94 96 def __init__(self, name, capacity=None, latency=None, attribute=[]): 95 self.name = name97 self.name = "%s" % name 96 98 self.capacity = self.init_class(Capacity, capacity) 97 99 self.latency = self.init_class(Latency, latency) … … 124 126 class CPU(base): 125 127 def __init__(self, type, attribute=[]): 126 self.type = type128 self.type = "%s" % type 127 129 self.attribute = [ self.init_class(Attribute, a) for a in \ 128 130 self.make_list(attribute) ] … … 141 143 def __init__(self, amount, persistence, attribute=[]): 142 144 self.amount = float(amount) 143 self.presistence = persistence145 self.presistence = "%s" % persistence 144 146 self.attribute = [ self.init_class(Attribute, a) \ 145 147 for a in self.make_list(attribute) ] … … 158 160 def __init__(self, name=None, version=None, distribution=None, 159 161 distributionversion=None, attribute=[]): 160 self.name = name161 self.version = version162 self.distribution = distribution163 self.distributionversion = distributionversion162 self.name = "%s" % name 163 self.version = "%s" % version 164 self.distribution = "%s" % distribution 165 self.distributionversion = "%s" % distributionversion 164 166 self.attribute = [ self.init_class(Attribute, a) \ 165 167 for a in self.make_list(attribute) ] … … 184 186 class Software(base): 185 187 def __init__(self, location, install=None, attribute=[]): 186 self.location = location187 self.install = install188 self.location = "%s" % location 189 self.install = "%s" % install 188 190 self.attribute = [ self.init_class(Attribute, a)\ 189 191 for a in self.make_list(attribute) ] … … 203 205 def __init__(self, substrate, name=None, capacity=None, latency=None, 204 206 attribute=[], element=None): 205 self.name = name207 self.name = "%s" % name 206 208 self.substrate = self.make_list(substrate) 207 209 self.capacity = self.init_class(Capacity, capacity) … … 236 238 def __init__(self, fedid=None, uuid=None, uri=None, localname=None, 237 239 kerberosUsername=None): 238 self.fedid=fedid 239 self.uuid = uuid240 self.uri = uri241 self.localname = localname242 self.kerberosUsername = kerberosUsername240 self.fedid=fedid_class(hexstr="%s" % fedid) 241 self.uuid = "%s" % uuid 242 self.uri = "%s" % uri 243 self.localname ="%s" % localname 244 self.kerberosUsername = "%s" % kerberosUsername 243 245 244 246 def clone(self): … … 261 263 i.element = self 262 264 263 self.name = name265 self.name = "%s" % name 264 266 self.cpu = [ self.init_class(CPU, c) for c in self.make_list(cpu) ] 265 267 self.os = [ self.init_class(OperatingSystem, c) \ … … 306 308 class Testbed(base): 307 309 def __init__(self, uri, type, interface=[], attribute=[]): 308 self.uri = uri309 self.type = type310 self.uri = "%s" % uri 311 self.type = "%s" % type 310 312 self.interface = [ self.init_class(Interface, c) \ 311 313 for c in self.make_list(interface) ] … … 331 333 def __init__(self, id, type, uri, interface=[], attribute=[]): 332 334 self.id = self.init_class(ID, id) 333 self.type = type334 self.uri = uri335 self.type = "%s" % type 336 self.uri = "%s" % uri 335 337 self.interface = [ self.init_class(Interface, c) \ 336 338 for c in self.make_list(interface) ]
Note: See TracChangeset
for help on using the changeset viewer.