Revision 151 sip-settings
| new-sipclients/sip-settings 2012-09-02 04:07:23.000000000 +0200 | ||
|---|---|---|
| 70 | 70 |
print linebuf |
| 71 | 71 |
|
| 72 | 72 |
|
| 73 |
|
|
| 73 |
|
|
| 74 | 74 |
[display_object(getattr(obj, child), child) for child in dir(type(obj)) if isinstance(getattr(type(obj), child, None), SettingsGroupMeta)] |
| 75 | 75 |
|
| 76 | 76 |
class SettingsParser(object): |
| ... | ... | |
| 231 | 231 |
if not accounts: |
| 232 | 232 |
print 'No accounts which match %s' % sip_address |
| 233 | 233 |
return |
| 234 |
|
|
| 234 |
|
|
| 235 | 235 |
try: |
| 236 | 236 |
settings = dict(arg.split('=', 1) for arg in args)
|
| 237 | 237 |
except ValueError: |
| 238 | 238 |
print 'Illegal arguments: %s' % ' '.join(args) |
| 239 | 239 |
return |
| 240 |
|
|
| 240 |
|
|
| 241 | 241 |
for account in accounts: |
| 242 | 242 |
for attrname, value in settings.iteritems(): |
| 243 | 243 |
object = account |
| ... | ... | |
| 259 | 259 |
print 'Unknown setting: %s' % attrname |
| 260 | 260 |
except ValueError, e: |
| 261 | 261 |
print '%s: %s' % (attrname, str(e)) |
| 262 |
|
|
| 262 |
|
|
| 263 | 263 |
account.save() |
| 264 | 264 |
print 'Account%s updated' % ('s' if len(accounts) > 1 else '')
|
| 265 | 265 |
|
| ... | ... | |
| 298 | 298 |
except ValueError: |
| 299 | 299 |
print 'Illegal arguments: %s' % ' '.join(args) |
| 300 | 300 |
return |
| 301 |
|
|
| 301 |
|
|
| 302 | 302 |
for attrname, value in settings.iteritems(): |
| 303 | 303 |
object = sipsimple_settings |
| 304 | 304 |
name = attrname |
| ... | ... | |
| 319 | 319 |
print 'Unknown setting: %s' % attrname |
| 320 | 320 |
except ValueError, e: |
| 321 | 321 |
print '%s: %s' % (attrname, str(e)) |
| 322 |
|
|
| 322 |
|
|
| 323 | 323 |
sipsimple_settings.save() |
| 324 | 324 |
print 'SIP SIMPLE general settings updated' |
| 325 | 325 |
|
Also available in: Unified diff