Revision 151
| new-sipclients/sip-settings 2012-09-02 03:58:53.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 |
|
| new-sipclients/sip-subscribe-presence 2012-09-02 03:58:53.000000000 +0200 | ||
|---|---|---|
| 118 | 118 |
account_manager = AccountManager() |
| 119 | 119 |
configuration = ConfigurationManager() |
| 120 | 120 |
engine = Engine() |
| 121 |
|
|
| 121 |
|
|
| 122 | 122 |
# start output thread |
| 123 | 123 |
self.output.start() |
| 124 |
|
|
| 124 |
|
|
| 125 | 125 |
# startup configuration |
| 126 | 126 |
Account.register_extension(AccountExtension) |
| 127 | 127 |
BonjourAccount.register_extension(AccountExtension) |
| ... | ... | |
| 204 | 204 |
reactor.run() |
| 205 | 205 |
finally: |
| 206 | 206 |
self.input.stop() |
| 207 |
|
|
| 207 |
|
|
| 208 | 208 |
# stop the output |
| 209 | 209 |
self.output.stop() |
| 210 | 210 |
self.output.join() |
| 211 |
|
|
| 211 |
|
|
| 212 | 212 |
self.logger.stop() |
| 213 | 213 |
|
| 214 | 214 |
return 0 if self.success else 1 |
| ... | ... | |
| 229 | 229 |
message += ' Ctrl-d: quit the program\n' |
| 230 | 230 |
message += ' ?: display this help message\n' |
| 231 | 231 |
self.output.put('\n'+message)
|
| 232 |
|
|
| 232 |
|
|
| 233 | 233 |
def handle_notification(self, notification): |
| 234 | 234 |
handler = getattr(self, '_NH_%s' % notification.name, None) |
| 235 | 235 |
if handler is not None: |
| ... | ... | |
| 357 | 357 |
reactor.stop() |
| 358 | 358 |
except ReactorNotRunning: |
| 359 | 359 |
pass |
| 360 |
|
|
| 360 |
|
|
| 361 | 361 |
def _subscribe(self): |
| 362 | 362 |
settings = SIPSimpleSettings() |
| 363 |
|
|
| 363 |
|
|
| 364 | 364 |
self._subscription_timeout = time()+30 |
| 365 | 365 |
|
| 366 | 366 |
lookup = DNSLookup() |
Also available in: Unified diff