rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if transport in self.account.sip.transport_list and uri != self.account.contact[transport]: | if transport in self.account.sip.transport_list and uri != self.account.contact[transport] and uri not in self._neighbours: self._neighbours.add(uri) | def _resolve_cb(self, file, flags, interface_index, error_code, fullname, host_target, port, txtrecord): notification_center = NotificationCenter() if error_code == bonjour.kDNSServiceErr_NoError: txt = bonjour.TXTRecord.parse(txtrecord) contact = txt['contact'].strip('<>') if 'contact' in txt else None if contact: dis... |
distutils_exec_process("svn status \"%s\" | grep ^\?| awk '{print $2}' | xargs -I '{}' rm '{}'" % (self.svn_dir,), True, shell=True) | if sys.platform == "win32": distutils_exec_process("bash svn status \"%s\" | grep ^\?| awk '{print $2}' | xargs -I '{}' rm '{}'" % (self.svn_dir,), True, shell=True) else: distutils_exec_process("svn status \"%s\" | grep ^\?| awk '{print $2}' | xargs -I '{}' rm '{}'" % (self.svn_dir,), True, shell=True) | def fetch_pjsip_from_svn(self): self.svn_dir = os.path.join(self.pjsip_build_dir or self.build_temp, "pjsip") if not os.path.exists(self.svn_dir): log.info("Fetching PJSIP from SVN repository") distutils_exec_process(["svn", "co", "-r", self.pjsip_svn_revision, self.pjsip_svn_repo, self.svn_dir], True, input='t'+os.lin... |
password=credentials.password if credentials else '') | password=credentials.password if credentials else '', use_tls=settings.msrp.transport=='tls') | def initialize(self, session, direction): self.greenlet = api.getcurrent() settings = SIPSimpleSettings() notification_center = NotificationCenter() notification_center.add_observer(self, sender=self) try: self.session = session outgoing = direction=='outgoing' if isinstance(self.account, Account): if (outgoing and sel... |
portaudio_patch_files = ["patches/portaudio-1420-runtime_device_change_detection.patch"] | portaudio_patch_files = ["patches/portaudio-1420-runtime_device_change_detection.patch", "patches/portaudio-pa_linux_alsa.c_pulse_1.patch", "patches/portaudio-pa_linux_alsa.c_pulse_2.patch"] | def get_svn_revision(svn_dir, max_revision=None): environment = dict((name, value) for name, value in os.environ.iteritems() if name!='LANG' and not name.startswith('LC_')) environment['LC_ALL'] = 'C' if max_revision is None: svn_info = distutils_exec_process(["svn", "info", svn_dir], True, env=environment) else: svn_i... |
tmp_filename = os.path.join(os.path.dirname(self.filename), '%s.%d.%08X' % (self.filename, os.getpid(), random.getrandbits(32))) | config_directory = os.path.dirname(self.filename) tmp_filename = '%s.%d.%08X' % (self.filename, os.getpid(), random.getrandbits(32)) | def save(self, data): """ Given a dictionary conforming to the IConfigurationBackend specification, write the data to the file configured with this backend in a format suitable to be read back using load(). """ lines = self._build_group(data, 0) tmp_filename = os.path.join(os.path.dirname(self.filename), '%s.%d.%08X' %... |
elif self.enabled and 'sip.register' in notification.data.modified: if self.sip.register: self._registrar.activate() else: self._registrar.deactivate() elif self.enabled and set(['message_summary.enabled', 'message_summary.voicemail_uri']).intersection(notification.data.modified): if self.message_summary.enabled: self.... | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account or start/stop/reload the registration process if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() elif self.enabled and 'sip.register' in notification.data.modif... | |
if set(['auth.password', 'auth.username', 'sip.outbound_proxy', 'sip.transport_list', 'sip.register_interval']).intersection(notification.data.modified) and self.sip.register: self._registrar.reload_settings() if set(['auth.password', 'auth.username', 'sip.outbound_proxy', 'sip.transport_list', 'sip.subscribe_interval'... | registrar_attributes = ['auth.password', 'auth.username', 'sip.outbound_proxy', 'sip.transport_list', 'sip.register_interval'] voicemail_attributes = ['auth.password', 'auth.username', 'sip.outbound_proxy', 'sip.transport_list', 'sip.subscribe_interval', 'message_summary.voicemail_uri'] if 'sip.register' in notificatio... | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account or start/stop/reload the registration process if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() elif self.enabled and 'sip.register' in notification.data.modif... |
if self._invitation is None or self._invitation.state in (None, 'disconnecting', 'disconnected'): | if self._invitation is None or self._invitation.state is None: notification_center.post_notification('SIPSessionDidFail', self, TimestampedNotificationData(originator='local', code=487, reason='Session Cancelled', failure_reason='user request', redirect_identities=None)) return if self._invitation.state in ('disconnec... | def end(self): if self.greenlet is not None: api.kill(self.greenlet, api.GreenletExit()) self.greenlet = api.getcurrent() notification_center = NotificationCenter() if self._invitation is None or self._invitation.state in (None, 'disconnecting', 'disconnected'): return self.state = 'terminating' if self._invitation.sta... |
for uri in list(chain(*(r.strings for r in answer.rrset))): parsed_uri = urlparse(uri) | for result_uri in list(chain(*(r.strings for r in answer.rrset))): parsed_uri = urlparse(result_uri) | def lookup_xcap_server(self, uri, timeout=3.0, lifetime=15.0): """ Performs a TXT query against xcap.<uri.host> and returns all results that look like HTTP URIs. """ log_context = dict(context='lookup_xcap_server', uri=uri) notification_center = NotificationCenter() |
results.append(uri) | results.append(result_uri) | def lookup_xcap_server(self, uri, timeout=3.0, lifetime=15.0): """ Performs a TXT query against xcap.<uri.host> and returns all results that look like HTTP URIs. """ log_context = dict(context='lookup_xcap_server', uri=uri) notification_center = NotificationCenter() |
ops = [RemoveContactOperation(uri=operation.contact.uri), AddContactOperation(contact=contact)] | ops = [RemoveContactOperation(contact=operation.contact), AddContactOperation(contact=contact)] | def _OH_update_contact(self, operation): if not self.resource_lists.supported: return resource_lists = self.resource_lists.content try: oma_buddylist = (child for child in resource_lists if isinstance(child, resourcelists.List) and child.name=='oma_buddylist').next() except StopIteration: # This should never happen as ... |
ndata = TimestampedNotificationData(context=context, failure=Failure(), reason='SIP session ended before media could initialize') | ndata = TimestampedNotificationData(context='initialize', failure=Failure(), reason='SIP session ended before media could initialize') | def initialize(self, session, direction): self.greenlet = api.getcurrent() notification_center = NotificationCenter() notification_center.add_observer(self, sender=self) try: self.session = session outgoing = direction=='outgoing' if isinstance(self.account, Account) and (outgoing and self.account.nat_traversal.use_msr... |
if e.data.prev_state in ('connecting', 'connected'): | if e.data.prev_state in ('connecting', 'connected') or getattr(e.data, 'method', None) == 'BYE': | def connect(self, to_header, routes, streams): self.greenlet = api.getcurrent() notification_center = NotificationCenter() settings = SIPSimpleSettings() |
notification_center = NotificationCenter() data = TimestampedNotificationData(message_id=chunk.message_id, message=chunk, code=chunk.status.code, reason=chunk.status.comment) if chunk.status.code == 200: notification_center.post_notification('ChatStreamDidDeliverMessage', self, data) else: notification_center.post_noti... | if chunk.message_id in self.sent_messages: self.sent_messages.remove(chunk.message_id) notification_center = NotificationCenter() data = TimestampedNotificationData(message_id=chunk.message_id, message=chunk, code=chunk.status.code, reason=chunk.status.comment) if chunk.status.code == 200: notification_center.post_noti... | def _handle_REPORT(self, chunk): # in theory, REPORT can come with Byte-Range which would limit the scope of the REPORT to the part of the message. notification_center = NotificationCenter() data = TimestampedNotificationData(message_id=chunk.message_id, message=chunk, code=chunk.status.code, reason=chunk.status.commen... |
if response.code!=200: | if message_id in self.sent_messages and response.code != 200: self.sent_message.remove(message_id) | def _on_transaction_response(self, message_id, response): if response.code!=200: data = TimestampedNotificationData(message_id=message_id, message=response, code=response.code, reason=response.comment) NotificationCenter().post_notification('ChatStreamDidNotDeliverMessage', self, data) |
message_id, message, content_type, failure_report, success_report = self.message_queue.wait() | message_id, message, content_type, failure_report, success_report, notify_progress = self.message_queue.wait() | def _message_queue_handler(self): notification_center = NotificationCenter() while True: message_id, message, content_type, failure_report, success_report = self.message_queue.wait() if self.msrp_session is None: # should we generate ChatStreamDidNotDeliver per each message in the queue here? break chunk = self.msrp_se... |
notification_center.post_notification('ChatStreamDidSendMessage', self, TimestampedNotificationData(message=chunk)) | if notify_progress and success_report == 'yes' and failure_report != 'no': self.sent_messages.add(message_id) notification_center.post_notification('ChatStreamDidSendMessage', self, TimestampedNotificationData(message=chunk)) | def _message_queue_handler(self): notification_center = NotificationCenter() while True: message_id, message, content_type, failure_report, success_report = self.message_queue.wait() if self.msrp_session is None: # should we generate ChatStreamDidNotDeliver per each message in the queue here? break chunk = self.msrp_se... |
def _enqueue_message(self, message_id, message, content_type, failure_report=None, success_report=None): self.message_queue.send((message_id, message, content_type, failure_report, success_report)) | def _enqueue_message(self, message_id, message, content_type, failure_report=None, success_report=None, notify_progress=True): self.message_queue.send((message_id, message, content_type, failure_report, success_report, notify_progress)) | def _enqueue_message(self, message_id, message, content_type, failure_report=None, success_report=None): self.message_queue.send((message_id, message, content_type, failure_report, success_report)) |
self._enqueue_message(message_id, str(msg), 'message/cpim', failure_report='partial', success_report='yes') | self._enqueue_message(message_id, str(msg), 'message/cpim', failure_report='partial', success_report='yes', notify_progress=True) | def send_message(self, content, content_type='text/plain', remote_identity=None, dt=None): """Send IM message. Prefer Message/CPIM wrapper if it is supported. If called before the connection was established, the messages will be queued until MediaStreamDidStart notification. |
self._enqueue_message(message_id, content, content_type) | self._enqueue_message(message_id, content, content_type, failure_report='partial', success_report='yes', notify_progress=True) | def send_message(self, content, content_type='text/plain', remote_identity=None, dt=None): """Send IM message. Prefer Message/CPIM wrapper if it is supported. If called before the connection was established, the messages will be queued until MediaStreamDidStart notification. |
self._enqueue_message(message_id, content, IsComposingMessage.content_type, failure_report='partial', success_report='no') | self._enqueue_message(message_id, content, IsComposingMessage.content_type, failure_report='partial', success_report='no', notify_progress=False) | def send_composing_indication(self, state, refresh, last_active=None, remote_identity=None): if self.direction == 'recvonly': raise ChatStreamError('Cannot send message on recvonly stream') if state not in ('active', 'idle'): raise ValueError('Invalid value for composing indication state') message_id = '%x' % random.ge... |
notification_center = NotificationCenter() notification_center.add_observer(self, name='CFGSettingsObjectDidChange', sender=self) | def start(self): if self._started: return self._started = True | |
if not contains_mime_type(self.accept_types, content_type): raise ChatStreamError('Invalid content_type for outgoing message: %r' % content_type) | def send_message(self, content, content_type='text/plain', recipients=None, courtesy_recipients=None, subject=None, timestamp=None, required=None, additional_headers=None): """Send IM message. Prefer Message/CPIM wrapper if it is supported. If called before the connection was established, the messages will be queued un... | |
self.accounts[notification.data.old_id] = self.accounts.pop(notification.data.new_id) | self.accounts[notification.data.new_id] = self.accounts.pop(notification.data.old_id) | def _NH_CFGSettingsObjectDidChangeID(self, notification): self.accounts[notification.data.old_id] = self.accounts.pop(notification.data.new_id) |
def mdns_available(self): | def mdns_available(cls): | def mdns_available(self): return bonjour.available |
self.values.pop(obj, None) | if obj in self.values: self.values.pop(obj) self.dirty[obj] = True | def __set__(self, obj, value): if value is None and not self.nillable: raise ValueError("Setting attribute is not nillable") if value is DefaultValue: self.values.pop(obj, None) return |
pass | self.oldvalues.pop(obj, None) | def clear_dirty(self, obj): """ Clears the dirty flag for this setting on the specified configuration object. """ self.dirty.pop(obj, None) try: self.oldvalues[obj] = self.values[obj] except KeyError: pass |
self.server_advertised_uri = message_summary.message_account.replace('sip:', '', 1) or None | self.server_advertised_uri = message_summary.message_account and message_summary.message_account.replace('sip:', '', 1) or None | def _CH_subscribe(self, command): notification_center = NotificationCenter() settings = SIPSimpleSettings() |
self.server_advertised_uri = message_summary.message_account.replace('sip:', '', 1) or None | self.server_advertised_uri = message_summary.message_account and message_summary.message_account.replace('sip:', '', 1) or None | def _NH_SIPSubscriptionGotNotify(self, notification): if self.subscription is None: self._data_channel.send(notification) return if notification.sender is self.subscription and notification.data.event == 'message-summary' and notification.data.body: try: message_summary = MessageSummary.parse(notification.data.body) ex... |
headers_re = re.compile(r'(?:(.+?)\.)?(.+?):\s*(.+?)\r\n') | headers_re = re.compile(r'(?:([^:]+?)\.)?(.+?):\s*(.+?)\r\n') | def parse(cls, value): match = cls._re_format.match(value) if not match: raise ValueError('Cannot parse message/cpim identity header value: %r' % value) groupdict = match.groupdict() display_name = groupdict['display_name'] uri = groupdict['uri'] # FIXME: silly hack for sip-chatserver which sends incorrect URIs. -Luci... |
TimestampedNotificationData(originator='local', method='BYE', code=notification.data.code, reason=notification.data.reason)) | TimestampedNotificationData(originator=originator, method='BYE', code=code, reason=reason)) | def _fail(self, originator, code, reason, error): notification_center = NotificationCenter() prev_inv_state = self._invitation.state self.state = 'terminating' if prev_inv_state not in (None, 'incoming', 'outgoing', 'early', 'connecting'): notification_center.post_notification('SIPSessionWillEnd', self, TimestampedNoti... |
if self._current_command is not None and self._current_command.name in ('subscribe'): | if self._current_command is not None and self._current_command.name == 'subscribe': | def stop(self): """ Stops the XCAP manager. This method blocks until all the operations are stopped and needs to be called in a green thread. """ if self.state in ('stopping', 'stopped'): return notification_center = NotificationCenter() notification_center.post_notification('XCAPManagerWillEnd', sender=self, data=Time... |
raise ValueError("illegal MSRP relay address: %s" % description) | raise ValueError("illegal SIP proxy address: %s" % description) | def from_description(cls, description): if not description: return None match = cls._description_re.match(description) if match is None: raise ValueError("illegal MSRP relay address: %s" % description) return cls(**dict((k, v) for k, v in match.groupdict().iteritems() if v is not None)) |
stream.device.input_muted = True stream.device.output_muted = True | stream.bridge.remove(stream.device) | def add(self, stream): with self._lock: if stream in self.streams: return stream.device.input_muted = True stream.device.output_muted = True self.bridge.add(stream.bridge) self.streams.append(stream) |
stream.device.input_muted = False stream.device.output_muted = False | stream.bridge.add(stream.device) | def remove(self, stream): with self._lock: self.streams.remove(stream) self.bridge.remove(stream.bridge) stream.device.input_muted = False stream.device.output_muted = False |
local_ip = host.outgoing_ip_for(self._invitation.sdp.proposed_remote.connection.address) | sdp_connection = self._invitation.sdp.proposed_remote.connection or (media.connection for media in self._invitation.sdp.proposed_remote.media if media.connection is not None).next() local_ip = host.outgoing_ip_for(sdp_connection.address) | def accept(self, streams): self.greenlet = api.getcurrent() notification_center = NotificationCenter() settings = SIPSimpleSettings() |
self._command_channel.send(command) | reactor.callLater(1, self._command_channel.send, command) | def restart_discovery(self): command = Command('discover') self._command_channel.send(command) |
notification_center = NotificationCenter() | def _browse_cb(self, file, flags, interface_index, error_code, service_name, regtype, reply_domain): notification_center = NotificationCenter() if error_code != bonjour.kDNSServiceErr_NoError: self._discover_timer = reactor.callLater(1, self._command_channel.send, Command('discover')) return if not (flags & bonjour.kDN... | |
notification_center.post_notification('BonjourAccountDidRemoveNeighbour', sender=self.account, | NotificationCenter().post_notification('BonjourAccountDidRemoveNeighbour', sender=self.account, | def _browse_cb(self, file, flags, interface_index, error_code, service_name, regtype, reply_domain): notification_center = NotificationCenter() if error_code != bonjour.kDNSServiceErr_NoError: self._discover_timer = reactor.callLater(1, self._command_channel.send, Command('discover')) return if not (flags & bonjour.kDN... |
notification_center = NotificationCenter() | def _resolve_cb(self, file, flags, interface_index, error_code, fullname, host_target, port, txtrecord): notification_center = NotificationCenter() settings = SIPSimpleSettings() if error_code == bonjour.kDNSServiceErr_NoError: txt = bonjour.TXTRecord.parse(txtrecord) contact = txt['contact'].strip('<>') if 'contact' i... | |
notification_center.post_notification('BonjourAccountDidAddNeighbour', sender=self.account, | NotificationCenter().post_notification('BonjourAccountDidAddNeighbour', sender=self.account, | def _resolve_cb(self, file, flags, interface_index, error_code, fullname, host_target, port, txtrecord): notification_center = NotificationCenter() settings = SIPSimpleSettings() if error_code == bonjour.kDNSServiceErr_NoError: txt = bonjour.TXTRecord.parse(txtrecord) contact = txt['contact'].strip('<>') if 'contact' i... |
notification_center = NotificationCenter() notification_center.post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) | NotificationCenter().post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) | def _CH_unregister(self, command): if self._register_timer is not None: self._register_timer.cancel() self._register_timer = None old_files = [] for file in (f for f in self._files[:] if f.type=='registration'): old_files.append(file) self._files.remove(file) self._select_proc.kill(RestartSelect) for file in old_files:... |
def _CH_discover(self, command): notification_center = NotificationCenter() | def _CH_undiscover(self, command): | def _CH_discover(self, command): notification_center = NotificationCenter() settings = SIPSimpleSettings() if self._discover_timer is not None and self._discover_timer.active(): self._discover_timer.cancel() self._discover_timer = None notification_center.post_notification('BonjourAccountWillRestartDiscovery', sender=s... |
notification_center.post_notification('BonjourAccountWillRestartDiscovery', sender=self.account, data=TimestampedNotificationData()) | def _CH_discover(self, command): notification_center = NotificationCenter() settings = SIPSimpleSettings() if self._discover_timer is not None and self._discover_timer.active(): self._discover_timer.cancel() self._discover_timer = None notification_center.post_notification('BonjourAccountWillRestartDiscovery', sender=s... | |
for file in command.files: | for file in (f for f in command.files if not f.closed): | def _CH_process_results(self, command): for file in command.files: try: bonjour.DNSServiceProcessResult(file.file) except: # Should we close the file? The documentation doesn't say anything about this. -Luci import traceback traceback.print_exc() # reinsert the files which were not closed in the select list for file in... |
notification_center = NotificationCenter() notification_center.post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) | NotificationCenter().post_notification('BonjourAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData()) | def _CH_stop(self, command): if self._discover_timer is not None: self._discover_timer.cancel() self._discover_timer = None if self._register_timer is not None: self._register_timer.cancel() self._register_timer = None old_files = self._files self._files = [] self._select_proc.kill(RestartSelect) self._neighbours = set... |
if 'display_name' in notification.data.modified: | if self.enabled and 'display_name' in notification.data.modified: | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() if 'display_name' in notification.data.modified: self._bonjour_services.restart_registration() if any(option ... |
if any(option in notification.data.modified for option in ('sip.transport_list','tls.certificate')): notification_center = NotificationCenter() notification_center.post_notification('BonjourNeighbourDiscoveryWillRestart', sender=self, data=TimestampedNotificationData()) | if self.enabled and set(['sip.transport_list', 'tls.certificate']).intersection(notification.data.modified): NotificationCenter().post_notification('BonjourNeighbourDiscoveryWillRestart', sender=self, data=TimestampedNotificationData()) | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() if 'display_name' in notification.data.modified: self._bonjour_services.restart_registration() if any(option ... |
if self.started: | if self._started: | def _NH_CFGSettingsObjectDidChange(self, notification): # update credentials attribute if 'password' in notification.data.modified: self.credentials.password = self.password |
if not self.sip.enable_register: | if self.sip.enable_register: | def _NH_CFGSettingsObjectDidChange(self, notification): # update credentials attribute if 'password' in notification.data.modified: self.credentials.password = self.password |
self.extra_headers.append(Header("Event", self.event)) self.extra_headers.append(Header("Expires", str(int(self.duration) if do_publish else 0))) | extra_headers = [] extra_headers.append(Header("Event", self.event)) extra_headers.append(Header("Expires", str(int(self.duration) if do_publish else 0))) | def _make_and_send_request(self, body, route_header, timeout, do_publish): notification_center = NotificationCenter() self.extra_headers.append(Header("Event", self.event)) self.extra_headers.append(Header("Expires", str(int(self.duration) if do_publish else 0))) if self._last_etag is not None: self.extra_headers.appe... |
self.extra_headers.append(Header("SIP-If-Match", self._last_etag)) | extra_headers.append(Header("SIP-If-Match", self._last_etag)) extra_headers.extend(self.extra_headers) | def _make_and_send_request(self, body, route_header, timeout, do_publish): notification_center = NotificationCenter() self.extra_headers.append(Header("Event", self.event)) self.extra_headers.append(Header("Expires", str(int(self.duration) if do_publish else 0))) if self._last_etag is not None: self.extra_headers.appe... |
credentials=self.credentials, cseq=1, extra_headers=self.extra_headers, | credentials=self.credentials, cseq=1, extra_headers=extra_headers, | def _make_and_send_request(self, body, route_header, timeout, do_publish): notification_center = NotificationCenter() self.extra_headers.append(Header("Event", self.event)) self.extra_headers.append(Header("Expires", str(int(self.duration) if do_publish else 0))) if self._last_etag is not None: self.extra_headers.appe... |
configuration.update(self.__group__, self.__id__, self.__getstate__()) | def save(self): """ Use the ConfigurationManager to store the object under its id in the specified group or top-level otherwise, depending on whether group is None. | |
notification = self._channel.wait() | try: notification = self._channel.wait() except MediaStreamDidFailError: continue | def end(self): if self.greenlet is not None: api.kill(self.greenlet, api.GreenletExit()) self.greenlet = api.getcurrent() notification_center = NotificationCenter() if self._invitation is None or self._invitation.state in (None, 'disconnecting', 'disconnected'): return self.state = 'terminating' if self._invitation.sta... |
display_name = txt['name'] if 'name' in txt else None | display_name = txt['name'].decode('utf-8') if 'name' in txt else None | def _resolve_cb(self, file, flags, interface_index, error_code, fullname, host_target, port, txtrecord): notification_center = NotificationCenter() if error_code == bonjour.kDNSServiceErr_NoError: txt = bonjour.TXTRecord.parse(txtrecord) contact = txt['contact'].strip('<>') if 'contact' in txt else None if contact: dis... |
return (self.name == other.name and self.uri == other.uri and self.group == other.group and self.attributes == other.attributes and self.presence_policies == other.presence_policies and self.dialoginfo_policies == other.dialoginfo_policies and self.subscribe_to_presence == other.subscribe_to_presence and self.subscribe... | if isinstance(other, Contact): return (self.name == other.name and self.uri == other.uri and self.group == other.group and self.attributes == other.attributes and self.presence_policies == other.presence_policies and self.dialoginfo_policies == other.dialoginfo_policies and self.subscribe_to_presence == other.subscribe... | def __eq__(self, other): return (self.name == other.name and self.uri == other.uri and self.group == other.group and self.attributes == other.attributes and self.presence_policies == other.presence_policies and self.dialoginfo_policies == other.dialoginfo_policies and self.subscribe_to_presence == other.subscribe_to_pr... |
return self.exceptions == other.exceptions | if isinstance(other, CatchAllCondition): return self.exceptions == other.exceptions return False | def __eq__(self, other): return self.exceptions == other.exceptions |
return self.domain == other.domain and self.exceptions == other.exceptions | if isinstance(other, DomainCondition): return self.domain == other.domain and self.exceptions == other.exceptions return False | def __eq__(self, other): return self.domain == other.domain and self.exceptions == other.exceptions |
return self.domain == other.domain | if isinstance(other, DomainException): return self.domain == other.domain return False | def __eq__(self, other): return self.domain == other.domain |
return self.uri == other.uri | if isinstance(other, UserException): return self.uri == other.uri return False | def __eq__(self, other): return self.uri == other.uri |
return (self.id == other.id and self.action == other.action and self.name == other.name and self.validity == other.validity and self.sphere == other.sphere and self.multi_identity_conditions == other.multi_identity_conditions) | if isinstance(other, Policy): return (self.id == other.id and self.action == other.action and self.name == other.name and self.validity == other.validity and self.sphere == other.sphere and self.multi_identity_conditions == other.multi_identity_conditions) return False | def __eq__(self, other): return (self.id == other.id and self.action == other.action and self.name == other.name and self.validity == other.validity and self.sphere == other.sphere and self.multi_identity_conditions == other.multi_identity_conditions) |
self.bridge.add(self.device) | self._streams.append(self) | def initialize(self, session, direction): with self._lock: self.bridge.add(self.device) if self.state != "NULL": raise RuntimeError("AudioStream.initialize() may only be called in the NULL state") self.state = "INITIALIZING" self._session = session if hasattr(self, "_incoming_remote_sdp"): # ICE attributes could come a... |
if child_cls is not None and (True if child_cls is [c for c in [UrisTypeEntry]] else False): | if child_cls is not None and child_cls is UrisTypeEntry: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [UrisTypeEntry]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError: p... |
if child_cls is not None and (True if child_cls is [c for c in [ConfUrisEntry]] else False): | if child_cls is not None and child_cls is ConfUrisEntry: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [ConfUrisEntry]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError: p... |
if child_cls is not None and (True if child_cls is [c for c in [ServiceUrisEntry]] else False): | if child_cls is not None and child_cls is ServiceUrisEntry: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [ServiceUrisEntry]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError... |
if child_cls is not None and (True if child_cls is [c for c in [AvailableMediaEntry]] else False): | if child_cls is not None and child_cls is AvailableMediaEntry: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [AvailableMediaEntry]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationEr... |
if child_cls is not None and (True if child_cls is [c for c in [Role]] else False): | if child_cls is not None and child_cls is Role: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [Role]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError: pass |
if child_cls is not None and (True if child_cls is [c for c in [Endpoint]] else False): | if child_cls is not None and child_cls is Endpoint: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [Endpoint]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError: pass |
if child_cls is not None and (True if child_cls is [c for c in [User]] else False): | if child_cls is not None and child_cls is User: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [User]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError: pass |
if child_cls is not None and (True if child_cls is [c for c in [SidebarsByValEntry]] else False): | if child_cls is not None and child_cls is SidebarsByValEntry: | def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [SidebarsByValEntry]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationErr... |
else: | elif e.code == 408 or 500 <= e.code <= 599: | def _CH_subscribe(self, command): if self.state in ('stopping', 'stopped'): return notification_center = NotificationCenter() settings = SIPSimpleSettings() if self.subscription_timer is not None and self.subscription_timer.active(): self.subscription_timer.cancel() self.subscription_timer = None if self.subscription i... |
try: field = line.split(":")[0].strip() rest = "".join(line.split(":")[1:]).strip() except IndexError: | field, sep, rest = line.partition(':') if not field and not rest: | def parse(content): message = StringIO(content) summary = MessageSummary() tmp_header = [] for line in message: if line == '\r\n': if tmp_header: summary.optional_headers.append(tmp_header) tmp_header = [] continue else: try: field = line.split(":")[0].strip() rest = "".join(line.split(":")[1:]).strip() except IndexErr... |
SettingsObject, overwriting any attributes with the same name. Other attriutes in the extension are ignored. | SettingsObject, overwriting any attributes with the same name. Other attributes in the extension are ignored. | def register_extension(cls, extension): """ Register an extension of this SettingsObject. All Settings and SettingsGroups defined in the extension will be added to this SettingsObject, overwriting any attributes with the same name. Other attriutes in the extension are ignored. """ if not issubclass(extension, SettingsO... |
for line, lineno in izip(open(self.filename), count(1)): | for line, lineno in izip(file, count(1)): | def load(self): """ Read the file configured with this backend and parse it, returning a dictionary conforming to the IConfigurationBackend specification. """ READ_NAME, READ_VALUE = range(2) |
self._reactor_thread = Thread(name='Reactor Thread', target=self._run_reactor) self._reactor_thread.setDaemon(True) self._reactor_thread.start() | Thread(name='Reactor Thread', target=self._run_reactor).start() | def start(self, config_backend): with self._lock: if self.state is not None: raise RuntimeError("SIPApplication cannot be started from '%s' state" % self.state) self.state = 'starting' |
self._reactor_thread.join(15.0) | def stop(self): with self._lock: if self.state in (None, 'stopping', 'stopped'): return prev_state = self.state self.state = 'stopping' | |
while True: notification = self._channel.wait() if notification.name == 'SIPEngineDidEnd': break | try: with api.timeout(15): while True: notification = self._channel.wait() if notification.name == 'SIPEngineDidEnd': break except api.TimeoutError: pass | def _shutdown_subsystems(self): # shutdown middleware components account_manager = AccountManager() session_manager = SessionManager() procs = [proc.spawn(account_manager.stop), proc.spawn(session_manager.stop)] proc.waitall(procs) |
NotificationCenter().post_notification('MSRPLibraryLog', data=TimestampedNotificationData(message=message, level=self.level.DEBUG)) | pass | def debug(self, message, **context): NotificationCenter().post_notification('MSRPLibraryLog', data=TimestampedNotificationData(message=message, level=self.level.DEBUG)) |
send_notice('Audio RTP parameters changed:') send_notice('Audio stream using "%s" codec at %sHz' % (stream.codec, stream.sample_rate)) send_notice('Audio RTP endpoints %s:%d <-> %s:%d' % (stream.local_rtp_address, stream.local_rtp_port, stream.remote_rtp_address, stream.remote_rtp_port)) | self.output.put('Audio RTP parameters changed:\n') self.output.put('Audio stream using "%s" codec at %sHz\n' % (stream.codec, stream.sample_rate)) self.output.put('Audio RTP endpoints %s:%d <-> %s:%d\n' % (stream.local_rtp_address, stream.local_rtp_port, stream.remote_rtp_address, stream.remote_rtp_port)) | def _NH_AudioStreamDidChangeRTPParameters(self, notification): stream = notification.sender send_notice('Audio RTP parameters changed:') send_notice('Audio stream using "%s" codec at %sHz' % (stream.codec, stream.sample_rate)) send_notice('Audio RTP endpoints %s:%d <-> %s:%d' % (stream.local_rtp_address, stream.local_r... |
send_notice('RTP audio stream is encrypted') | self.output.put('RTP audio stream is encrypted\n') | def _NH_AudioStreamDidChangeRTPParameters(self, notification): stream = notification.sender send_notice('Audio RTP parameters changed:') send_notice('Audio stream using "%s" codec at %sHz' % (stream.codec, stream.sample_rate)) send_notice('Audio RTP endpoints %s:%d <-> %s:%d' % (stream.local_rtp_address, stream.local_r... |
m = re.match("((\d)\/(\d))(\ \((\d)\/(\d)\))?", rest) | m = re.match("((\d+)\/(\d+))(\ \((\d+)\/(\d+)\))?", rest) | def parse(content): message = StringIO(content) summary = MessageSummary() tmp_header = [] for line in message: if line == '\r\n': if tmp_header: summary.optional_headers.append(tmp_header) tmp_header = [] continue else: try: field = line.split(":")[0].strip() rest = "".join(line.split(":")[1:]).strip() except IndexErr... |
if self.remote_rtp_port != remote_sdp.media[stream_index].port: | if self._rtp_transport.remote_rtp_port_sdp != remote_sdp.media[stream_index].port: | def update(self, local_sdp, remote_sdp, stream_index): with self._lock: if self.remote_rtp_port != remote_sdp.media[stream_index].port: settings = SIPSimpleSettings() if self._audio_rec is not None: self.bridge.remove(self._audio_rec) old_consumer_slot = self.consumer_slot old_producer_slot = self.producer_slot self.no... |
elif set(['auth.password', 'auth.username', 'sip.outbound_proxy', 'sip.transport_list']).intersection(notification.data.modified): | elif self.enabled and 'message_summary.enabled' in notification.data.modified: if self.message_summary.enabled: self._mwi_handler.activate() else: self._mwi_handler.deactivate() elif self.enabled and set(['auth.password', 'auth.username', 'sip.outbound_proxy', 'sip.transport_list']).intersection(notification.data.modif... | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account or start/stop/reload the registration process if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() elif self.enabled and 'sip.register' in notification.data.modif... |
elif set(['sip.register_interval']).intersection(notification.data.modified) and self.enabled and self.sip.register: | elif self.enabled and 'sip.register_interval' in notification.data.modified and self.sip.register: | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account or start/stop/reload the registration process if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() elif self.enabled and 'sip.register' in notification.data.modif... |
elif set(['sip.subscribe_interval']).intersection(notification.data.modified) and self.enabled and self.message_summary.enabled: | elif self.enabled and 'sip.subscribe_interval' in notification.data.modified and self.message_summary.enabled: | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account or start/stop/reload the registration process if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() elif self.enabled and 'sip.register' in notification.data.modif... |
class Endpoint(XMLElement): | class Endpoint(XMLListElement): | def __init__(self, sip=None): XMLElement.__init__(self) self.sip = sip |
media = XMLElementChild('media', type=Media, required=False, test_equal=True) | def __init__(self, sip=None): XMLElement.__init__(self) self.sip = sip | |
def __init__(self, entity, state='full', display_text=None, referred=None, status=None, joining_method=None, joining_info=None, disconnection_method=None, disconnection_info=None, media=None, call_info=None): XMLElement.__init__(self) | def __init__(self, entity, state='full', display_text=None, referred=None, status=None, joining_method=None, joining_info=None, disconnection_method=None, disconnection_info=None, call_info=None, media=[]): XMLListElement.__init__(self) | def __init__(self, entity, state='full', display_text=None, referred=None, status=None, joining_method=None, joining_info=None, disconnection_method=None, disconnection_info=None, media=None, call_info=None): XMLElement.__init__(self) self.entity = entity self.state = state self.display_text = display_text self.referre... |
self.media = media | def __init__(self, entity, state='full', display_text=None, referred=None, status=None, joining_method=None, joining_info=None, disconnection_method=None, disconnection_info=None, media=None, call_info=None): XMLElement.__init__(self) self.entity = entity self.state = state self.display_text = display_text self.referre... | |
self._mwi_handler.subscribe() | self._mwi_handler.activate() | def _NH_CFGSettingsObjectDidChange(self, notification): # activate/deactivate the account or start/stop/reload the registration process if self._started: if 'enabled' in notification.data.modified: if self.enabled: self._activate() else: self._deactivate() elif self.enabled and 'sip.register' in notification.data.modif... |
self._mwi_handler.subscribe() | self._mwi_handler.activate() | def _NH_CFGSettingsObjectDidChangeID(self, notification): if self._started and self.enabled: if self.sip.register: self._registrar.reload_settings() if self.message_summary.enabled: self._mwi_handler.subscribe() |
def _get_message(self, message): | def _get_message(self): | def _get_message(self, message): return self._message |
tls_port=settings.sip.tls_port if 'tls' in settings.sip.transport_list else None, | tls_port=None, | def _initialize_subsystems(self): account_manager = AccountManager() dns_manager = DNSManager() engine = Engine() notification_center = NotificationCenter() session_manager = SessionManager() settings = SIPSimpleSettings() |
engine.set_tls_options(port=settings.sip.tls_port, | engine.set_tls_options(port=settings.sip.tls_port if 'tls' in settings.sip.transport_list else None, | def _initialize_subsystems(self): account_manager = AccountManager() dns_manager = DNSManager() engine = Engine() notification_center = NotificationCenter() session_manager = SessionManager() settings = SIPSimpleSettings() |
dt = cls(int(dct['year']), month=int(dct['month']), day=int(dct['day']), hour=int(dct['hour']), minute=int(dct['minute']), second=int(dct['second']), microsecond=secfrac) return dt - timedelta(seconds=secoffset) + timedelta(seconds=cls.utc_offset()*60) | dt = datetime(int(dct['year']), month=int(dct['month']), day=int(dct['day']), hour=int(dct['hour']), minute=int(dct['minute']), second=int(dct['second']), microsecond=secfrac) return cls(dt - timedelta(seconds=secoffset) + timedelta(seconds=cls.utc_offset()*60)) | def parse(cls, stamp): if stamp is None: return None match = cls._timestamp_re.match(stamp) if match is None: raise ValueError("Timestamp %s is not in RFC3339 format" % stamp) dct = match.groupdict() if dct['UTC'] is not None: secoffset = 0 else: secoffset = int(dct['tzminute'])*60 + int(dct['tzhour'])*3600 if dct['tzs... |
self._command_channel.send_exception(GreenletExit) | self._command_channel.send_exception(api.GreenletExit) | def stop(self): notification_center = NotificationCenter() notification_center.remove_observer(self, name='SystemIPAddressDidChange') notification_center.remove_observer(self, name='SystemDidWakeUpFromSleep') self._command_channel.send_exception(GreenletExit) |
@run_in_green_thread | def _NH_SIPSubscriptionDidFail(self, notification): if notification.sender is self.subscription: self._command_channel.send(Command('subscribe')) else: self._data_channel.send_exception(SIPSubscriptionDidFail(notification.data)) | |
self._command_channel.send_exception(GreenletExit) | self._command_channel.send_exception(api.GreenletExit) | def stop(self): notification_center = NotificationCenter() notification_center.remove_observer(self, name='SystemIPAddressDidChange') notification_center.remove_observer(self, name='SystemDidWakeUpFromSleep') self._select_proc.kill() self._command_channel.send_exception(GreenletExit) |
if self._current_command is not None and self._current_command.name == 'subscribe': | if self._current_command is not None and self._current_command.name != 'unsubscribe': | def stop(self): """ Stops the XCAP manager. This method blocks until all the operations are stopped and needs to be called in a green thread. """ if self.state in ('stopping', 'stopped'): return notification_center = NotificationCenter() notification_center.post_notification('XCAPManagerWillEnd', sender=self, data=Time... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.