Changeset 6487
- Timestamp:
- Dec 28, 2008, 1:16:26 AM (16 years ago)
- Location:
- trunk/exodus/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exodus/scripts/README
r6486 r6487 14 14 15 15 $ cd $EXODUSROOT 16 $ ./bin/django runscript genesis_to_exodus /PATH/TO/py.conf16 $ ./bin/django runscript genesis_to_exodus --verbosity=2 --traceback /PATH/TO/py.conf -
trunk/exodus/scripts/genesis_to_exodus.py
r6486 r6487 19 19 'latitude': location['lat'], 'longitude': location['lon'] }) 20 20 if not loc.is_valid(): 21 print location._errors 21 for i in loc.errors.keys(): 22 print loc.errors[i][0] 22 23 return None 23 24 locmodel = loc.save() 24 print 'Location ' + location['descr'] + ' created'25 print 'Location ' + location['descr'] + ' created' 25 26 return locmodel.id 26 27 … … 38 39 print 'Node '+node['name']+' created' 39 40 else: 40 print form._errors 41 for i in form.errors.keys(): 42 print form.errors[i][0] 41 43 return None 42 44 return nodemodel.id … … 56 58 print 'Can\'t import interface '+interface['iface'] 57 59 # XXX - outputs html but this is supposed to be a console script 58 print form._errors 60 # fixed output to text. 61 for i in form.errors.keys(): 62 print form.errors[i][0] 59 63 return None 60 64 return intfmodel.id … … 137 141 # XXX: The genesis data is complete, the type of 138 142 # antenna needs to be passed on. 139 # it's probably better 143 # it's probably better to define the types 144 # beforehand. 140 145 141 146 # handle Antenna … … 148 153 149 154 # handle wifi links 155 dhcp = config.get(cfgsection, 'dhcp') 156 if dhcp != 'no': 157 interface['accesspoint'] = True 150 158 if config.has_option(cfgsection, 'ssid'): 151 159 ssid = interface['ssid'] … … 154 162 if interface['mode'] == 'ms': 155 163 #XXX: if dhcp != 'no' accesspoint = 1 156 interface['accesspoint'] = 1 164 # fixed this above. 165 #interface['accesspoint'] = 1 157 166 networks[ssid]['master'] = import_interface(interface) 158 167 else: 159 networks[ssid]['links'].append(interface) ;168 networks[ssid]['links'].append(interface) 160 169 else: 161 170 # XXX - should we handle links on not-wifi … … 163 172 # XXX: yes we should 164 173 import_interface(interface) 174 pass 175 165 176 166 177 # now we have already created all nodes and master interfaces... … … 173 184 # trying to update interfaces progressively 174 185 175 # XXX:this needn't be done, because exodus defines the ssid. 186 # XXX: my initial thought was that you defined the ssid here, but 187 # you use it to determine who is the master and this seems to work 188 # well. 176 189 for ssid in networks: 177 190 for interface in networks[ssid]['links']:
Note:
See TracChangeset
for help on using the changeset viewer.