repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_documentation_string
stringlengths
1
47.2k
func_code_url
stringlengths
85
339
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher.remove_bundle_listener
def remove_bundle_listener(self, listener): """ Unregisters a bundle listener :param listener: The bundle listener to unregister :return: True if the listener has been unregistered, else False """ with self.__bnd_lock: if listener not in self.__bnd_listeners:...
python
def remove_bundle_listener(self, listener): """ Unregisters a bundle listener :param listener: The bundle listener to unregister :return: True if the listener has been unregistered, else False """ with self.__bnd_lock: if listener not in self.__bnd_listeners:...
Unregisters a bundle listener :param listener: The bundle listener to unregister :return: True if the listener has been unregistered, else False
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L757-L769
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher.remove_framework_listener
def remove_framework_listener(self, listener): """ Unregisters a framework stop listener :param listener: The framework listener to unregister :return: True if the listener has been unregistered, else False """ with self.__fw_lock: try: self._...
python
def remove_framework_listener(self, listener): """ Unregisters a framework stop listener :param listener: The framework listener to unregister :return: True if the listener has been unregistered, else False """ with self.__fw_lock: try: self._...
Unregisters a framework stop listener :param listener: The framework listener to unregister :return: True if the listener has been unregistered, else False
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L771-L783
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher.remove_service_listener
def remove_service_listener(self, listener): """ Unregisters a service listener :param listener: The service listener :return: True if the listener has been unregistered """ with self.__svc_lock: try: data = self.__listeners_data.pop(listener)...
python
def remove_service_listener(self, listener): """ Unregisters a service listener :param listener: The service listener :return: True if the listener has been unregistered """ with self.__svc_lock: try: data = self.__listeners_data.pop(listener)...
Unregisters a service listener :param listener: The service listener :return: True if the listener has been unregistered
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L785-L801
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher.fire_bundle_event
def fire_bundle_event(self, event): """ Notifies bundle events listeners of a new event in the calling thread. :param event: The bundle event """ with self.__bnd_lock: # Copy the list of listeners listeners = self.__bnd_listeners[:] # Call'em all...
python
def fire_bundle_event(self, event): """ Notifies bundle events listeners of a new event in the calling thread. :param event: The bundle event """ with self.__bnd_lock: # Copy the list of listeners listeners = self.__bnd_listeners[:] # Call'em all...
Notifies bundle events listeners of a new event in the calling thread. :param event: The bundle event
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L803-L818
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher.fire_framework_stopping
def fire_framework_stopping(self): """ Calls all framework listeners, telling them that the framework is stopping """ with self.__fw_lock: # Copy the list of listeners listeners = self.__fw_listeners[:] for listener in listeners: try: ...
python
def fire_framework_stopping(self): """ Calls all framework listeners, telling them that the framework is stopping """ with self.__fw_lock: # Copy the list of listeners listeners = self.__fw_listeners[:] for listener in listeners: try: ...
Calls all framework listeners, telling them that the framework is stopping
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L820-L836
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher.fire_service_event
def fire_service_event(self, event): """ Notifies service events listeners of a new event in the calling thread. :param event: The service event """ # Get the service properties properties = event.get_service_reference().get_properties() svc_specs = properties[OB...
python
def fire_service_event(self, event): """ Notifies service events listeners of a new event in the calling thread. :param event: The service event """ # Get the service properties properties = event.get_service_reference().get_properties() svc_specs = properties[OB...
Notifies service events listeners of a new event in the calling thread. :param event: The service event
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L838-L902
tcalmant/ipopo
pelix/internals/registry.py
EventDispatcher._filter_with_hooks
def _filter_with_hooks(self, svc_event, listeners): """ Filters listeners with EventListenerHooks :param svc_event: ServiceEvent being triggered :param listeners: Listeners to filter :return: A list of listeners with hook references """ svc_ref = svc_event.get_se...
python
def _filter_with_hooks(self, svc_event, listeners): """ Filters listeners with EventListenerHooks :param svc_event: ServiceEvent being triggered :param listeners: Listeners to filter :return: A list of listeners with hook references """ svc_ref = svc_event.get_se...
Filters listeners with EventListenerHooks :param svc_event: ServiceEvent being triggered :param listeners: Listeners to filter :return: A list of listeners with hook references
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L904-L963
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.clear
def clear(self): """ Clears the registry """ with self.__svc_lock: self.__svc_registry.clear() self.__svc_factories.clear() self.__svc_specs.clear() self.__bundle_svc.clear() self.__bundle_imports.clear() self.__fact...
python
def clear(self): """ Clears the registry """ with self.__svc_lock: self.__svc_registry.clear() self.__svc_factories.clear() self.__svc_specs.clear() self.__bundle_svc.clear() self.__bundle_imports.clear() self.__fact...
Clears the registry
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1016-L1027
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.register
def register( self, bundle, classes, properties, svc_instance, factory, prototype ): """ Registers a service. :param bundle: The bundle that registers the service :param classes: The classes implemented by the service :param properties: The properties associated to t...
python
def register( self, bundle, classes, properties, svc_instance, factory, prototype ): """ Registers a service. :param bundle: The bundle that registers the service :param classes: The classes implemented by the service :param properties: The properties associated to t...
Registers a service. :param bundle: The bundle that registers the service :param classes: The classes implemented by the service :param properties: The properties associated to the service :param svc_instance: The instance of the service :param factory: If True, the given servic...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1029-L1088
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.__sort_registry
def __sort_registry(self, svc_ref): # type: (ServiceReference) -> None """ Sorts the registry, after the update of the sort key of given service reference :param svc_ref: A service reference with a modified sort key """ with self.__svc_lock: if svc_re...
python
def __sort_registry(self, svc_ref): # type: (ServiceReference) -> None """ Sorts the registry, after the update of the sort key of given service reference :param svc_ref: A service reference with a modified sort key """ with self.__svc_lock: if svc_re...
Sorts the registry, after the update of the sort key of given service reference :param svc_ref: A service reference with a modified sort key
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1090-L1115
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.unregister
def unregister(self, svc_ref): # type: (ServiceReference) -> Any """ Unregisters a service :param svc_ref: A service reference :return: The unregistered service instance :raise BundleException: Unknown service reference """ with self.__svc_lock: ...
python
def unregister(self, svc_ref): # type: (ServiceReference) -> Any """ Unregisters a service :param svc_ref: A service reference :return: The unregistered service instance :raise BundleException: Unknown service reference """ with self.__svc_lock: ...
Unregisters a service :param svc_ref: A service reference :return: The unregistered service instance :raise BundleException: Unknown service reference
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1117-L1165
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.hide_bundle_services
def hide_bundle_services(self, bundle): """ Hides the services of the given bundle (removes them from lists, but lets them be unregistered) :param bundle: The bundle providing services :return: The references of the hidden services """ with self.__svc_lock: ...
python
def hide_bundle_services(self, bundle): """ Hides the services of the given bundle (removes them from lists, but lets them be unregistered) :param bundle: The bundle providing services :return: The references of the hidden services """ with self.__svc_lock: ...
Hides the services of the given bundle (removes them from lists, but lets them be unregistered) :param bundle: The bundle providing services :return: The references of the hidden services
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1167-L1203
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.find_service_references
def find_service_references( self, clazz=None, ldap_filter=None, only_one=False ): """ Finds all services references matching the given filter. :param clazz: Class implemented by the service :param ldap_filter: Service filter :param only_one: Return the first matchin...
python
def find_service_references( self, clazz=None, ldap_filter=None, only_one=False ): """ Finds all services references matching the given filter. :param clazz: Class implemented by the service :param ldap_filter: Service filter :param only_one: Return the first matchin...
Finds all services references matching the given filter. :param clazz: Class implemented by the service :param ldap_filter: Service filter :param only_one: Return the first matching service reference only :return: A list of found references, or None :raise BundleException: An er...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1205-L1266
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.get_bundle_imported_services
def get_bundle_imported_services(self, bundle): """ Returns this bundle's ServiceReference list for all services it is using or returns None if this bundle is not using any services. A bundle is considered to be using a service if its use count for that service is greater than ze...
python
def get_bundle_imported_services(self, bundle): """ Returns this bundle's ServiceReference list for all services it is using or returns None if this bundle is not using any services. A bundle is considered to be using a service if its use count for that service is greater than ze...
Returns this bundle's ServiceReference list for all services it is using or returns None if this bundle is not using any services. A bundle is considered to be using a service if its use count for that service is greater than zero. The list is valid at the time of the call to this metho...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1268-L1283
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.get_bundle_registered_services
def get_bundle_registered_services(self, bundle): # type: (Any) -> List[ServiceReference] """ Retrieves the services registered by the given bundle. Returns None if the bundle didn't register any service. :param bundle: The bundle to look into :return: The references to ...
python
def get_bundle_registered_services(self, bundle): # type: (Any) -> List[ServiceReference] """ Retrieves the services registered by the given bundle. Returns None if the bundle didn't register any service. :param bundle: The bundle to look into :return: The references to ...
Retrieves the services registered by the given bundle. Returns None if the bundle didn't register any service. :param bundle: The bundle to look into :return: The references to the services registered by the bundle
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1285-L1295
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.get_service
def get_service(self, bundle, reference): # type: (Any, ServiceReference) -> Any """ Retrieves the service corresponding to the given reference :param bundle: The bundle requiring the service :param reference: A service reference :return: The requested service :r...
python
def get_service(self, bundle, reference): # type: (Any, ServiceReference) -> Any """ Retrieves the service corresponding to the given reference :param bundle: The bundle requiring the service :param reference: A service reference :return: The requested service :r...
Retrieves the service corresponding to the given reference :param bundle: The bundle requiring the service :param reference: A service reference :return: The requested service :raise BundleException: The service could not be found
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1297-L1324
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.__get_service_from_factory
def __get_service_from_factory(self, bundle, reference): # type: (Any, ServiceReference) -> Any """ Returns a service instance from a service factory or a prototype service factory :param bundle: The bundle requiring the service :param reference: A reference pointing to ...
python
def __get_service_from_factory(self, bundle, reference): # type: (Any, ServiceReference) -> Any """ Returns a service instance from a service factory or a prototype service factory :param bundle: The bundle requiring the service :param reference: A reference pointing to ...
Returns a service instance from a service factory or a prototype service factory :param bundle: The bundle requiring the service :param reference: A reference pointing to a factory :return: The requested service :raise BundleException: The service could not be found
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1326-L1359
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.unget_used_services
def unget_used_services(self, bundle): """ Cleans up all service usages of the given bundle. :param bundle: Bundle to be cleaned up """ # Pop used references try: imported_refs = list(self.__bundle_imports.pop(bundle)) except KeyError: # N...
python
def unget_used_services(self, bundle): """ Cleans up all service usages of the given bundle. :param bundle: Bundle to be cleaned up """ # Pop used references try: imported_refs = list(self.__bundle_imports.pop(bundle)) except KeyError: # N...
Cleans up all service usages of the given bundle. :param bundle: Bundle to be cleaned up
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1361-L1397
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.unget_service
def unget_service(self, bundle, reference, service=None): # type: (Any, ServiceReference, Any) -> bool """ Removes the usage of a service by a bundle :param bundle: The bundle that used the service :param reference: A service reference :param service: Service instance (f...
python
def unget_service(self, bundle, reference, service=None): # type: (Any, ServiceReference, Any) -> bool """ Removes the usage of a service by a bundle :param bundle: The bundle that used the service :param reference: A service reference :param service: Service instance (f...
Removes the usage of a service by a bundle :param bundle: The bundle that used the service :param reference: A service reference :param service: Service instance (for Prototype Service Factories) :return: True if the bundle usage has been removed
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1399-L1433
tcalmant/ipopo
pelix/internals/registry.py
ServiceRegistry.__unget_service_from_factory
def __unget_service_from_factory(self, bundle, reference, service=None): # type: (Any, ServiceReference, Any) -> bool """ Removes the usage of a a service factory or a prototype service factory by a bundle :param bundle: The bundle that used the service :param reference:...
python
def __unget_service_from_factory(self, bundle, reference, service=None): # type: (Any, ServiceReference, Any) -> bool """ Removes the usage of a a service factory or a prototype service factory by a bundle :param bundle: The bundle that used the service :param reference:...
Removes the usage of a a service factory or a prototype service factory by a bundle :param bundle: The bundle that used the service :param reference: A service reference :param service: Service instance (for prototype factories) :return: True if the bundle usage has been removed
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L1435-L1479
tcalmant/ipopo
pelix/remote/edef_io.py
EDEFReader._convert_value
def _convert_value(vtype, value): """ Converts the given value string according to the given type :param vtype: Type of the value :param value: String form of the value :return: The converted value :raise ValueError: Conversion failed """ # Normalize valu...
python
def _convert_value(vtype, value): """ Converts the given value string according to the given type :param vtype: Type of the value :param value: String form of the value :return: The converted value :raise ValueError: Conversion failed """ # Normalize valu...
Converts the given value string according to the given type :param vtype: Type of the value :param value: String form of the value :return: The converted value :raise ValueError: Conversion failed
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/edef_io.py#L122-L148
tcalmant/ipopo
pelix/remote/edef_io.py
EDEFWriter._indent
def _indent(self, element, level=0, prefix="\t"): """ In-place Element text auto-indent, for pretty printing. Code from: http://effbot.org/zone/element-lib.htm#prettyprint :param element: An Element object :param level: Level of indentation :param prefix: String to use ...
python
def _indent(self, element, level=0, prefix="\t"): """ In-place Element text auto-indent, for pretty printing. Code from: http://effbot.org/zone/element-lib.htm#prettyprint :param element: An Element object :param level: Level of indentation :param prefix: String to use ...
In-place Element text auto-indent, for pretty printing. Code from: http://effbot.org/zone/element-lib.htm#prettyprint :param element: An Element object :param level: Level of indentation :param prefix: String to use for each indentation
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/edef_io.py#L253-L283
tcalmant/ipopo
pelix/remote/edef_io.py
EDEFWriter._add_container
def _add_container(props_node, tag, container): """ Walks through the given container and fills the node :param props_node: A property node :param tag: Name of the container tag :param container: The container """ values_node = ElementTree.SubElement(props_node, ...
python
def _add_container(props_node, tag, container): """ Walks through the given container and fills the node :param props_node: A property node :param tag: Name of the container tag :param container: The container """ values_node = ElementTree.SubElement(props_node, ...
Walks through the given container and fills the node :param props_node: A property node :param tag: Name of the container tag :param container: The container
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/edef_io.py#L286-L297
tcalmant/ipopo
pelix/remote/edef_io.py
EDEFWriter._get_type
def _get_type(name, value): """ Returns the type associated to the given name or value :param name: Property name :param value: Property value :return: A value type name """ # Types forced for known keys if name in TYPED_BOOL: return TYPE_BOOL...
python
def _get_type(name, value): """ Returns the type associated to the given name or value :param name: Property name :param value: Property value :return: A value type name """ # Types forced for known keys if name in TYPED_BOOL: return TYPE_BOOL...
Returns the type associated to the given name or value :param name: Property name :param value: Property value :return: A value type name
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/edef_io.py#L300-L343
tcalmant/ipopo
pelix/remote/edef_io.py
EDEFWriter.to_string
def to_string(self, endpoints): """ Converts the given endpoint description beans into a string :param endpoints: A list of EndpointDescription beans :return: A string containing an XML document """ # Make the ElementTree root = self._make_xml(endpoints) ...
python
def to_string(self, endpoints): """ Converts the given endpoint description beans into a string :param endpoints: A list of EndpointDescription beans :return: A string containing an XML document """ # Make the ElementTree root = self._make_xml(endpoints) ...
Converts the given endpoint description beans into a string :param endpoints: A list of EndpointDescription beans :return: A string containing an XML document
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/edef_io.py#L413-L449
tcalmant/ipopo
pelix/misc/xmpp.py
BasicBot.connect
def connect( self, host, port=5222, reattempt=False, use_tls=True, use_ssl=False ): # pylint: disable=W0221 """ Connects to the server. By default, uses an un-encrypted connection, as it won't connect to an OpenFire server otherwise :param host: Server host ...
python
def connect( self, host, port=5222, reattempt=False, use_tls=True, use_ssl=False ): # pylint: disable=W0221 """ Connects to the server. By default, uses an un-encrypted connection, as it won't connect to an OpenFire server otherwise :param host: Server host ...
Connects to the server. By default, uses an un-encrypted connection, as it won't connect to an OpenFire server otherwise :param host: Server host name :param port: Server port (default: 5222) :param reattempt: If True, tries to connect to the server until it ...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/xmpp.py#L72-L104
tcalmant/ipopo
pelix/misc/xmpp.py
BasicBot.on_session_start
def on_session_start(self, data): # pylint: disable=W0613 """ XMPP session started """ # Send initial presence self.send_presence(ppriority=self._initial_priority) # Request roster self.get_roster()
python
def on_session_start(self, data): # pylint: disable=W0613 """ XMPP session started """ # Send initial presence self.send_presence(ppriority=self._initial_priority) # Request roster self.get_roster()
XMPP session started
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/xmpp.py#L106-L115
tcalmant/ipopo
pelix/misc/xmpp.py
InviteMixIn.on_invite
def on_invite(self, data): """ Multi-User Chat invite """ if not self._nick: self._nick = self.boundjid.user # Join the room self.plugin["xep_0045"].joinMUC(data["from"], self._nick)
python
def on_invite(self, data): """ Multi-User Chat invite """ if not self._nick: self._nick = self.boundjid.user # Join the room self.plugin["xep_0045"].joinMUC(data["from"], self._nick)
Multi-User Chat invite
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/xmpp.py#L154-L162
tcalmant/ipopo
pelix/misc/xmpp.py
ServiceDiscoveryMixin.iter_services
def iter_services(self, feature=None): """ Iterates over the root-level services on the server which provides the requested feature :param feature: Feature that the service must provide (optional) :return: A generator of services JID """ # Get the list of root se...
python
def iter_services(self, feature=None): """ Iterates over the root-level services on the server which provides the requested feature :param feature: Feature that the service must provide (optional) :return: A generator of services JID """ # Get the list of root se...
Iterates over the root-level services on the server which provides the requested feature :param feature: Feature that the service must provide (optional) :return: A generator of services JID
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/xmpp.py#L181-L212
tcalmant/ipopo
pelix/shell/parser.py
_find_assignment
def _find_assignment(arg_token): """ Find the first non-escaped assignment in the given argument token. Returns -1 if no assignment was found. :param arg_token: The argument token :return: The index of the first assignment, or -1 """ idx = arg_token.find("=") while idx != -1: if...
python
def _find_assignment(arg_token): """ Find the first non-escaped assignment in the given argument token. Returns -1 if no assignment was found. :param arg_token: The argument token :return: The index of the first assignment, or -1 """ idx = arg_token.find("=") while idx != -1: if...
Find the first non-escaped assignment in the given argument token. Returns -1 if no assignment was found. :param arg_token: The argument token :return: The index of the first assignment, or -1
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L62-L79
tcalmant/ipopo
pelix/shell/parser.py
_make_args
def _make_args(args_list, session, fw_props): """ Converts the given list of arguments into a list (args) and a dictionary (kwargs). All arguments with an assignment are put into kwargs, others in args. :param args_list: The list of arguments to be treated :param session: The current shell sess...
python
def _make_args(args_list, session, fw_props): """ Converts the given list of arguments into a list (args) and a dictionary (kwargs). All arguments with an assignment are put into kwargs, others in args. :param args_list: The list of arguments to be treated :param session: The current shell sess...
Converts the given list of arguments into a list (args) and a dictionary (kwargs). All arguments with an assignment are put into kwargs, others in args. :param args_list: The list of arguments to be treated :param session: The current shell session :return: The (arg_token, kwargs) tuple.
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L90-L125
tcalmant/ipopo
pelix/shell/parser.py
_split_ns_command
def _split_ns_command(cmd_token): """ Extracts the name space and the command name of the given command token. :param cmd_token: The command token :return: The extracted (name space, command) tuple """ namespace = None cmd_split = cmd_token.split(".", 1) if len(cmd_split) == 1: ...
python
def _split_ns_command(cmd_token): """ Extracts the name space and the command name of the given command token. :param cmd_token: The command token :return: The extracted (name space, command) tuple """ namespace = None cmd_split = cmd_token.split(".", 1) if len(cmd_split) == 1: ...
Extracts the name space and the command name of the given command token. :param cmd_token: The command token :return: The extracted (name space, command) tuple
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L128-L150
tcalmant/ipopo
pelix/shell/parser.py
Shell.register_command
def register_command(self, namespace, command, method): """ Registers the given command to the shell. The namespace can be None, empty or "default" :param namespace: The command name space. :param command: The shell name of the command :param method: The method to call ...
python
def register_command(self, namespace, command, method): """ Registers the given command to the shell. The namespace can be None, empty or "default" :param namespace: The command name space. :param command: The shell name of the command :param method: The method to call ...
Registers the given command to the shell. The namespace can be None, empty or "default" :param namespace: The command name space. :param command: The shell name of the command :param method: The method to call :return: True if the method has been registered, False if it was ...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L204-L243
tcalmant/ipopo
pelix/shell/parser.py
Shell.get_command_completers
def get_command_completers(self, namespace, command): # type: (str, str) -> CompletionInfo """ Returns the completer method associated to the given command, or None :param namespace: The command name space. :param command: The shell name of the command :return: A Complet...
python
def get_command_completers(self, namespace, command): # type: (str, str) -> CompletionInfo """ Returns the completer method associated to the given command, or None :param namespace: The command name space. :param command: The shell name of the command :return: A Complet...
Returns the completer method associated to the given command, or None :param namespace: The command name space. :param command: The shell name of the command :return: A CompletionConfiguration object :raise KeyError: Unknown command or name space
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L245-L259
tcalmant/ipopo
pelix/shell/parser.py
Shell.unregister
def unregister(self, namespace, command=None): """ Unregisters the given command. If command is None, the whole name space is unregistered. :param namespace: The command name space. :param command: The shell name of the command, or None :return: True if the command was k...
python
def unregister(self, namespace, command=None): """ Unregisters the given command. If command is None, the whole name space is unregistered. :param namespace: The command name space. :param command: The shell name of the command, or None :return: True if the command was k...
Unregisters the given command. If command is None, the whole name space is unregistered. :param namespace: The command name space. :param command: The shell name of the command, or None :return: True if the command was known, else False
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L261-L296
tcalmant/ipopo
pelix/shell/parser.py
Shell.__find_command_ns
def __find_command_ns(self, command): """ Returns the name spaces where the given command named is registered. If the command exists in the default name space, the returned list will only contain the default name space. Returns an empty list of the command is unknown :pa...
python
def __find_command_ns(self, command): """ Returns the name spaces where the given command named is registered. If the command exists in the default name space, the returned list will only contain the default name space. Returns an empty list of the command is unknown :pa...
Returns the name spaces where the given command named is registered. If the command exists in the default name space, the returned list will only contain the default name space. Returns an empty list of the command is unknown :param command: A command name :return: A list of nam...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L298-L325
tcalmant/ipopo
pelix/shell/parser.py
Shell.get_namespaces
def get_namespaces(self): """ Retrieves the list of known name spaces (without the default one) :return: The list of known name spaces """ namespaces = list(self._commands.keys()) namespaces.remove(DEFAULT_NAMESPACE) namespaces.sort() return namespaces
python
def get_namespaces(self): """ Retrieves the list of known name spaces (without the default one) :return: The list of known name spaces """ namespaces = list(self._commands.keys()) namespaces.remove(DEFAULT_NAMESPACE) namespaces.sort() return namespaces
Retrieves the list of known name spaces (without the default one) :return: The list of known name spaces
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L327-L336
tcalmant/ipopo
pelix/shell/parser.py
Shell.get_commands
def get_commands(self, namespace): """ Retrieves the commands of the given name space. If *namespace* is None or empty, it retrieves the commands of the default name space :param namespace: The commands name space :return: A list of commands names """ if not name...
python
def get_commands(self, namespace): """ Retrieves the commands of the given name space. If *namespace* is None or empty, it retrieves the commands of the default name space :param namespace: The commands name space :return: A list of commands names """ if not name...
Retrieves the commands of the given name space. If *namespace* is None or empty, it retrieves the commands of the default name space :param namespace: The commands name space :return: A list of commands names
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L338-L357
tcalmant/ipopo
pelix/shell/parser.py
Shell.get_ns_commands
def get_ns_commands(self, cmd_name): """ Retrieves the possible name spaces and commands associated to the given command name. :param cmd_name: The given command name :return: A list of 2-tuples (name space, command) :raise ValueError: Unknown command name """ ...
python
def get_ns_commands(self, cmd_name): """ Retrieves the possible name spaces and commands associated to the given command name. :param cmd_name: The given command name :return: A list of 2-tuples (name space, command) :raise ValueError: Unknown command name """ ...
Retrieves the possible name spaces and commands associated to the given command name. :param cmd_name: The given command name :return: A list of 2-tuples (name space, command) :raise ValueError: Unknown command name
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L359-L380
tcalmant/ipopo
pelix/shell/parser.py
Shell.get_ns_command
def get_ns_command(self, cmd_name): """ Retrieves the name space and the command associated to the given command name. :param cmd_name: The given command name :return: A 2-tuple (name space, command) :raise ValueError: Unknown command name """ namespace, ...
python
def get_ns_command(self, cmd_name): """ Retrieves the name space and the command associated to the given command name. :param cmd_name: The given command name :return: A 2-tuple (name space, command) :raise ValueError: Unknown command name """ namespace, ...
Retrieves the name space and the command associated to the given command name. :param cmd_name: The given command name :return: A 2-tuple (name space, command) :raise ValueError: Unknown command name
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L382-L416
tcalmant/ipopo
pelix/shell/parser.py
Shell.execute
def execute(self, cmdline, session=None): """ Executes the command corresponding to the given line :param cmdline: Command line to parse :param session: Current shell session :return: True if command succeeded, else False """ if session is None: # Def...
python
def execute(self, cmdline, session=None): """ Executes the command corresponding to the given line :param cmdline: Command line to parse :param session: Current shell session :return: True if command succeeded, else False """ if session is None: # Def...
Executes the command corresponding to the given line :param cmdline: Command line to parse :param session: Current shell session :return: True if command succeeded, else False
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L418-L504
tcalmant/ipopo
pelix/shell/parser.py
Shell.__extract_help
def __extract_help(method): """ Formats the help string for the given method :param method: The method to document :return: A tuple: (arguments list, documentation line) """ if method is None: return "(No associated method)" # Get the arguments ...
python
def __extract_help(method): """ Formats the help string for the given method :param method: The method to document :return: A tuple: (arguments list, documentation line) """ if method is None: return "(No associated method)" # Get the arguments ...
Formats the help string for the given method :param method: The method to document :return: A tuple: (arguments list, documentation line)
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L507-L554
tcalmant/ipopo
pelix/shell/parser.py
Shell.__print_command_help
def __print_command_help(self, session, namespace, cmd_name): """ Prints the documentation of the given command :param session: Session handler :param namespace: Name space of the command :param cmd_name: Name of the command """ # Extract documentation ar...
python
def __print_command_help(self, session, namespace, cmd_name): """ Prints the documentation of the given command :param session: Session handler :param namespace: Name space of the command :param cmd_name: Name of the command """ # Extract documentation ar...
Prints the documentation of the given command :param session: Session handler :param namespace: Name space of the command :param cmd_name: Name of the command
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L556-L574
tcalmant/ipopo
pelix/shell/parser.py
Shell.__print_namespace_help
def __print_namespace_help(self, session, namespace, cmd_name=None): """ Prints the documentation of all the commands in the given name space, or only of the given command :param session: Session Handler :param namespace: Name space of the command :param cmd_name: Name o...
python
def __print_namespace_help(self, session, namespace, cmd_name=None): """ Prints the documentation of all the commands in the given name space, or only of the given command :param session: Session Handler :param namespace: Name space of the command :param cmd_name: Name o...
Prints the documentation of all the commands in the given name space, or only of the given command :param session: Session Handler :param namespace: Name space of the command :param cmd_name: Name of the command to show, None to show them all
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L576-L601
tcalmant/ipopo
pelix/shell/parser.py
Shell.print_help
def print_help(self, session, command=None): """ Prints the available methods and their documentation, or the documentation of the given command. """ if command: # Single command mode if command in self._commands: # Argument is a name space...
python
def print_help(self, session, command=None): """ Prints the available methods and their documentation, or the documentation of the given command. """ if command: # Single command mode if command in self._commands: # Argument is a name space...
Prints the available methods and their documentation, or the documentation of the given command.
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L603-L652
tcalmant/ipopo
pelix/shell/parser.py
Shell.var_set
def var_set(session, **kwargs): """ Sets the given variables or prints the current ones. "set answer=42" """ if not kwargs: for name, value in session.variables.items(): session.write_line("{0}={1}".format(name, value)) else: for name, valu...
python
def var_set(session, **kwargs): """ Sets the given variables or prints the current ones. "set answer=42" """ if not kwargs: for name, value in session.variables.items(): session.write_line("{0}={1}".format(name, value)) else: for name, valu...
Sets the given variables or prints the current ones. "set answer=42"
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L670-L681
tcalmant/ipopo
pelix/shell/parser.py
Shell.var_unset
def var_unset(session, name): """ Unsets the given variable """ name = name.strip() try: session.unset(name) except KeyError: session.write_line("Unknown variable: {0}", name) return False else: session.write_line("V...
python
def var_unset(session, name): """ Unsets the given variable """ name = name.strip() try: session.unset(name) except KeyError: session.write_line("Unknown variable: {0}", name) return False else: session.write_line("V...
Unsets the given variable
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L684-L697
tcalmant/ipopo
pelix/shell/parser.py
Shell.run_file
def run_file(self, session, filename): """ Runs the given "script" file """ try: with open(filename, "r") as filep: for lineno, line in enumerate(filep): line = line.strip() if not line or line.startswith("#"): ...
python
def run_file(self, session, filename): """ Runs the given "script" file """ try: with open(filename, "r") as filep: for lineno, line in enumerate(filep): line = line.strip() if not line or line.startswith("#"): ...
Runs the given "script" file
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/parser.py#L699-L726
tcalmant/ipopo
pelix/remote/xml_rpc.py
_XmlRpcServlet._simple_dispatch
def _simple_dispatch(self, name, params): """ Dispatch method """ try: # Internal method return self.funcs[name](*params) except KeyError: # Other method pass # Call the other method outside the except block, to avoid messy...
python
def _simple_dispatch(self, name, params): """ Dispatch method """ try: # Internal method return self.funcs[name](*params) except KeyError: # Other method pass # Call the other method outside the except block, to avoid messy...
Dispatch method
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/xml_rpc.py#L104-L117
tcalmant/ipopo
pelix/misc/init_handler.py
_Configuration.add_properties
def add_properties(self, properties): """ Updates the framework properties dictionary :param properties: New framework properties to add """ if isinstance(properties, dict): self._properties.update(properties)
python
def add_properties(self, properties): """ Updates the framework properties dictionary :param properties: New framework properties to add """ if isinstance(properties, dict): self._properties.update(properties)
Updates the framework properties dictionary :param properties: New framework properties to add
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L108-L115
tcalmant/ipopo
pelix/misc/init_handler.py
_Configuration.add_environment
def add_environment(self, environ): """ Updates the environment dictionary with the given one. Existing entries are overridden by the given ones :param environ: New environment variables """ if isinstance(environ, dict): self._environment.update(environ)
python
def add_environment(self, environ): """ Updates the environment dictionary with the given one. Existing entries are overridden by the given ones :param environ: New environment variables """ if isinstance(environ, dict): self._environment.update(environ)
Updates the environment dictionary with the given one. Existing entries are overridden by the given ones :param environ: New environment variables
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L126-L135
tcalmant/ipopo
pelix/misc/init_handler.py
_Configuration.add_paths
def add_paths(self, paths): """ Adds entries to the Python path. The given paths are normalized before being added to the left of the list :param paths: New paths to add """ if paths: # Use new paths in priority self._paths = list(paths) ...
python
def add_paths(self, paths): """ Adds entries to the Python path. The given paths are normalized before being added to the left of the list :param paths: New paths to add """ if paths: # Use new paths in priority self._paths = list(paths) ...
Adds entries to the Python path. The given paths are normalized before being added to the left of the list :param paths: New paths to add
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L147-L158
tcalmant/ipopo
pelix/misc/init_handler.py
_Configuration.add_components
def add_components(self, components): """ Adds a list of components to instantiate :param components: The description of components :raise KeyError: Missing component configuration """ if components: for component in components: self._componen...
python
def add_components(self, components): """ Adds a list of components to instantiate :param components: The description of components :raise KeyError: Missing component configuration """ if components: for component in components: self._componen...
Adds a list of components to instantiate :param components: The description of components :raise KeyError: Missing component configuration
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L198-L210
tcalmant/ipopo
pelix/misc/init_handler.py
_Configuration.normalize
def normalize(self): """ Normalizes environment variables, paths and filters the lists of bundles to install and start. After this call, the environment variables of this process will have been updated. """ # Add environment variables os.environ.update(se...
python
def normalize(self): """ Normalizes environment variables, paths and filters the lists of bundles to install and start. After this call, the environment variables of this process will have been updated. """ # Add environment variables os.environ.update(se...
Normalizes environment variables, paths and filters the lists of bundles to install and start. After this call, the environment variables of this process will have been updated.
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L223-L242
tcalmant/ipopo
pelix/misc/init_handler.py
InitFileHandler.find_default
def find_default(self, filename): """ A generate which looks in common folders for the default configuration file. The paths goes from system defaults to user specific files. :param filename: The name of the file to find :return: The complete path to the found files """ ...
python
def find_default(self, filename): """ A generate which looks in common folders for the default configuration file. The paths goes from system defaults to user specific files. :param filename: The name of the file to find :return: The complete path to the found files """ ...
A generate which looks in common folders for the default configuration file. The paths goes from system defaults to user specific files. :param filename: The name of the file to find :return: The complete path to the found files
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L289-L303
tcalmant/ipopo
pelix/misc/init_handler.py
InitFileHandler.load
def load(self, filename=None): """ Loads the given file and adds its content to the current state. This method can be called multiple times to merge different files. If no filename is given, this method loads all default files found. It returns False if no default configuration ...
python
def load(self, filename=None): """ Loads the given file and adds its content to the current state. This method can be called multiple times to merge different files. If no filename is given, this method loads all default files found. It returns False if no default configuration ...
Loads the given file and adds its content to the current state. This method can be called multiple times to merge different files. If no filename is given, this method loads all default files found. It returns False if no default configuration file has been found :param filename: The f...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L305-L323
tcalmant/ipopo
pelix/misc/init_handler.py
InitFileHandler.__parse
def __parse(self, configuration): """ Parses the given configuration dictionary :param configuration: A configuration as a dictionary (JSON object) """ for entry in ( "properties", "environment", "paths", "bundles", "co...
python
def __parse(self, configuration): """ Parses the given configuration dictionary :param configuration: A configuration as a dictionary (JSON object) """ for entry in ( "properties", "environment", "paths", "bundles", "co...
Parses the given configuration dictionary :param configuration: A configuration as a dictionary (JSON object)
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L325-L346
tcalmant/ipopo
pelix/misc/init_handler.py
InitFileHandler.normalize
def normalize(self): """ Normalizes environment variables and the Python path. This method first updates the environment variables (``os.environ``). Then, it normalizes the Python path (``sys.path``) by resolving all references to the user directory and environment variables. ...
python
def normalize(self): """ Normalizes environment variables and the Python path. This method first updates the environment variables (``os.environ``). Then, it normalizes the Python path (``sys.path``) by resolving all references to the user directory and environment variables. ...
Normalizes environment variables and the Python path. This method first updates the environment variables (``os.environ``). Then, it normalizes the Python path (``sys.path``) by resolving all references to the user directory and environment variables.
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L348-L367
tcalmant/ipopo
pelix/misc/init_handler.py
InitFileHandler.instantiate_components
def instantiate_components(self, context): """ Instantiate the defined components .. note:: This method requires the iPOPO core service to be registered. This means that the ``pelix.ipopo.core`` must have been declared in the list of bundles (or installed and st...
python
def instantiate_components(self, context): """ Instantiate the defined components .. note:: This method requires the iPOPO core service to be registered. This means that the ``pelix.ipopo.core`` must have been declared in the list of bundles (or installed and st...
Instantiate the defined components .. note:: This method requires the iPOPO core service to be registered. This means that the ``pelix.ipopo.core`` must have been declared in the list of bundles (or installed and started programmatically). :param context: A :class:`~pe...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/init_handler.py#L369-L384
moskytw/uniout
_uniout.py
literalize_string
def literalize_string(content, is_unicode=False): r'''Literalize a string content. Examples: >>> print literalize_string('str') 'str' >>> print literalize_string('\'str\'') "'str'" >>> print literalize_string('\"\'str\'\"') '"\'str\'"' ''' quote_mark = "'" if "'" in conten...
python
def literalize_string(content, is_unicode=False): r'''Literalize a string content. Examples: >>> print literalize_string('str') 'str' >>> print literalize_string('\'str\'') "'str'" >>> print literalize_string('\"\'str\'\"') '"\'str\'"' ''' quote_mark = "'" if "'" in conten...
r'''Literalize a string content. Examples: >>> print literalize_string('str') 'str' >>> print literalize_string('\'str\'') "'str'" >>> print literalize_string('\"\'str\'\"') '"\'str\'"'
https://github.com/moskytw/uniout/blob/8ea8fc84f3da297352e6b7335e354b41b40e7788/_uniout.py#L9-L32
moskytw/uniout
_uniout.py
unescape_string_literal
def unescape_string_literal(literal, encoding): r'''Unescape a string or unicode literal. Examples: >>> u = u'\u4e16\u754c\u4f60\u597d' # 世界你好 >>> print unescape_string_literal(repr(u), 'utf-8') u'世界你好' >>> print unescape_string_literal(repr(u.encode('utf-8')), 'utf-8') '世界你好' >>> pr...
python
def unescape_string_literal(literal, encoding): r'''Unescape a string or unicode literal. Examples: >>> u = u'\u4e16\u754c\u4f60\u597d' # 世界你好 >>> print unescape_string_literal(repr(u), 'utf-8') u'世界你好' >>> print unescape_string_literal(repr(u.encode('utf-8')), 'utf-8') '世界你好' >>> pr...
r'''Unescape a string or unicode literal. Examples: >>> u = u'\u4e16\u754c\u4f60\u597d' # 世界你好 >>> print unescape_string_literal(repr(u), 'utf-8') u'世界你好' >>> print unescape_string_literal(repr(u.encode('utf-8')), 'utf-8') '世界你好' >>> print unescape_string_literal(repr(u.encode('big5')), ...
https://github.com/moskytw/uniout/blob/8ea8fc84f3da297352e6b7335e354b41b40e7788/_uniout.py#L38-L74
moskytw/uniout
_uniout.py
unescape
def unescape(b, encoding): '''Unescape all string and unicode literals in bytes.''' return string_literal_re.sub( lambda m: unescape_string_literal(m.group(), encoding), b )
python
def unescape(b, encoding): '''Unescape all string and unicode literals in bytes.''' return string_literal_re.sub( lambda m: unescape_string_literal(m.group(), encoding), b )
Unescape all string and unicode literals in bytes.
https://github.com/moskytw/uniout/blob/8ea8fc84f3da297352e6b7335e354b41b40e7788/_uniout.py#L77-L82
moskytw/uniout
_uniout.py
make_unistream
def make_unistream(stream): '''Make a stream which unescapes string literals before writes out.''' unistream = lambda: 'I am an unistream!' # make unistream look like the stream for attr_name in dir(stream): if not attr_name.startswith('_'): setattr(unistream, attr_name, getattr(st...
python
def make_unistream(stream): '''Make a stream which unescapes string literals before writes out.''' unistream = lambda: 'I am an unistream!' # make unistream look like the stream for attr_name in dir(stream): if not attr_name.startswith('_'): setattr(unistream, attr_name, getattr(st...
Make a stream which unescapes string literals before writes out.
https://github.com/moskytw/uniout/blob/8ea8fc84f3da297352e6b7335e354b41b40e7788/_uniout.py#L96-L112
tcalmant/ipopo
pelix/shell/report.py
format_frame_info
def format_frame_info(frame): """ Formats the given stack frame to show its position in the code and part of its context :param frame: A stack frame """ # Same as in traceback.extract_stack line_no = frame.f_lineno code = frame.f_code filename = code.co_filename method_name = co...
python
def format_frame_info(frame): """ Formats the given stack frame to show its position in the code and part of its context :param frame: A stack frame """ # Same as in traceback.extract_stack line_no = frame.f_lineno code = frame.f_code filename = code.co_filename method_name = co...
Formats the given stack frame to show its position in the code and part of its context :param frame: A stack frame
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L65-L130
tcalmant/ipopo
pelix/shell/report.py
_extract_lines
def _extract_lines(filename, f_globals, line_no, around): """ Extracts a block of lines from the given file :param filename: Name of the source file :param f_globals: Globals of the frame of the current code :param line_no: Current line of code :param around: Number of line to print before and ...
python
def _extract_lines(filename, f_globals, line_no, around): """ Extracts a block of lines from the given file :param filename: Name of the source file :param f_globals: Globals of the frame of the current code :param line_no: Current line of code :param around: Number of line to print before and ...
Extracts a block of lines from the given file :param filename: Name of the source file :param f_globals: Globals of the frame of the current code :param line_no: Current line of code :param around: Number of line to print before and after the current one
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L133-L177
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.get_methods
def get_methods(self): """ Retrieves the list of tuples (command, method) for this command handler """ return [ ("levels", self.print_levels), ("make", self.make_report), ("clear", self.clear_report), ("show", self.show_report), ...
python
def get_methods(self): """ Retrieves the list of tuples (command, method) for this command handler """ return [ ("levels", self.print_levels), ("make", self.make_report), ("clear", self.clear_report), ("show", self.show_report), ...
Retrieves the list of tuples (command, method) for this command handler
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L251-L261
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.get_level_methods
def get_level_methods(self, level): """ Returns the methods to call for the given level of report :param level: The level of report :return: The set of methods to call to fill the report :raise KeyError: Unknown level or alias """ try: # Real name of ...
python
def get_level_methods(self, level): """ Returns the methods to call for the given level of report :param level: The level of report :return: The set of methods to call to fill the report :raise KeyError: Unknown level or alias """ try: # Real name of ...
Returns the methods to call for the given level of report :param level: The level of report :return: The set of methods to call to fill the report :raise KeyError: Unknown level or alias
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L263-L279
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.print_levels
def print_levels(self, session): """ Lists available levels """ lines = [] for level in sorted(self.get_levels()): methods = sorted( method.__name__ for method in self.get_level_methods(level) ) lines.append("- {0}:".format(leve...
python
def print_levels(self, session): """ Lists available levels """ lines = [] for level in sorted(self.get_levels()): methods = sorted( method.__name__ for method in self.get_level_methods(level) ) lines.append("- {0}:".format(leve...
Lists available levels
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L293-L304
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.os_details
def os_details(): """ Returns a dictionary containing details about the operating system """ # Compute architecture and linkage bits, linkage = platform.architecture() results = { # Machine details "platform.arch.bits": bits, "platform....
python
def os_details(): """ Returns a dictionary containing details about the operating system """ # Compute architecture and linkage bits, linkage = platform.architecture() results = { # Machine details "platform.arch.bits": bits, "platform....
Returns a dictionary containing details about the operating system
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L307-L347
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.process_details
def process_details(): """ Returns details about the current process """ results = {"argv": sys.argv, "working.directory": os.getcwd()} # Process ID and execution IDs (UID, GID, Login, ...) for key, method in { "pid": "getpid", "ppid": "getppid", ...
python
def process_details(): """ Returns details about the current process """ results = {"argv": sys.argv, "working.directory": os.getcwd()} # Process ID and execution IDs (UID, GID, Login, ...) for key, method in { "pid": "getpid", "ppid": "getppid", ...
Returns details about the current process
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L357-L378
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.network_details
def network_details(): """ Returns details about the network links """ # Get IPv4 details ipv4_addresses = [ info[4][0] for info in socket.getaddrinfo( socket.gethostname(), None, socket.AF_INET ) ] # Add localh...
python
def network_details(): """ Returns details about the network links """ # Get IPv4 details ipv4_addresses = [ info[4][0] for info in socket.getaddrinfo( socket.gethostname(), None, socket.AF_INET ) ] # Add localh...
Returns details about the network links
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L381-L430
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.python_details
def python_details(): """ Returns a dictionary containing details about the Python interpreter """ build_no, build_date = platform.python_build() results = { # Version of interpreter "build.number": build_no, "build.date": build_date, ...
python
def python_details(): """ Returns a dictionary containing details about the Python interpreter """ build_no, build_date = platform.python_build() results = { # Version of interpreter "build.number": build_no, "build.date": build_date, ...
Returns a dictionary containing details about the Python interpreter
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L433-L472
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.python_modules
def python_modules(): """ Returns the list of Python modules and their file """ imported = {} results = {"builtins": sys.builtin_module_names, "imported": imported} for module_name, module_ in sys.modules.items(): if module_name not in sys.builtin_module_names...
python
def python_modules(): """ Returns the list of Python modules and their file """ imported = {} results = {"builtins": sys.builtin_module_names, "imported": imported} for module_name, module_ in sys.modules.items(): if module_name not in sys.builtin_module_names...
Returns the list of Python modules and their file
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L486-L501
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.pelix_infos
def pelix_infos(self): """ Basic information about the Pelix framework instance """ framework = self.__context.get_framework() return { "version": framework.get_version(), "properties": framework.get_properties(), }
python
def pelix_infos(self): """ Basic information about the Pelix framework instance """ framework = self.__context.get_framework() return { "version": framework.get_version(), "properties": framework.get_properties(), }
Basic information about the Pelix framework instance
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L503-L511
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.pelix_bundles
def pelix_bundles(self): """ List of installed bundles """ framework = self.__context.get_framework() return { bundle.get_bundle_id(): { "name": bundle.get_symbolic_name(), "version": bundle.get_version(), "state": bundl...
python
def pelix_bundles(self): """ List of installed bundles """ framework = self.__context.get_framework() return { bundle.get_bundle_id(): { "name": bundle.get_symbolic_name(), "version": bundle.get_version(), "state": bundl...
List of installed bundles
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L513-L526
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.pelix_services
def pelix_services(self): """ List of registered services """ return { svc_ref.get_property(pelix.constants.SERVICE_ID): { "specifications": svc_ref.get_property( pelix.constants.OBJECTCLASS ), "ranking": svc...
python
def pelix_services(self): """ List of registered services """ return { svc_ref.get_property(pelix.constants.SERVICE_ID): { "specifications": svc_ref.get_property( pelix.constants.OBJECTCLASS ), "ranking": svc...
List of registered services
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L528-L545
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.ipopo_factories
def ipopo_factories(self): """ List of iPOPO factories """ try: with use_ipopo(self.__context) as ipopo: return { name: ipopo.get_factory_details(name) for name in ipopo.get_factories() } except B...
python
def ipopo_factories(self): """ List of iPOPO factories """ try: with use_ipopo(self.__context) as ipopo: return { name: ipopo.get_factory_details(name) for name in ipopo.get_factories() } except B...
List of iPOPO factories
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L547-L559
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.ipopo_instances
def ipopo_instances(self): """ List of iPOPO instances """ try: with use_ipopo(self.__context) as ipopo: return { instance[0]: ipopo.get_instance_details(instance[0]) for instance in ipopo.get_instances() ...
python
def ipopo_instances(self): """ List of iPOPO instances """ try: with use_ipopo(self.__context) as ipopo: return { instance[0]: ipopo.get_instance_details(instance[0]) for instance in ipopo.get_instances() ...
List of iPOPO instances
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L561-L573
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.threads_list
def threads_list(): """ Lists the active threads and their current code line """ results = {} # pylint: disable=W0212 try: # Extract frames frames = sys._current_frames() # Get the thread ID -> Thread mapping names = threa...
python
def threads_list(): """ Lists the active threads and their current code line """ results = {} # pylint: disable=W0212 try: # Extract frames frames = sys._current_frames() # Get the thread ID -> Thread mapping names = threa...
Lists the active threads and their current code line
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L576-L620
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.make_report
def make_report(self, session, *levels): """ Prepares the report at the requested level(s) """ if not levels: levels = ["full"] try: # List the methods to call, avoiding double-calls methods = set() for level in levels: ...
python
def make_report(self, session, *levels): """ Prepares the report at the requested level(s) """ if not levels: levels = ["full"] try: # List the methods to call, avoiding double-calls methods = set() for level in levels: ...
Prepares the report at the requested level(s)
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L622-L649
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.to_json
def to_json(self, data): """ Converts the given object to a pretty-formatted JSON string :param data: the object to convert to JSON :return: A pretty-formatted JSON string """ # Don't forget the empty line at the end of the file return ( json.dumps( ...
python
def to_json(self, data): """ Converts the given object to a pretty-formatted JSON string :param data: the object to convert to JSON :return: A pretty-formatted JSON string """ # Don't forget the empty line at the end of the file return ( json.dumps( ...
Converts the given object to a pretty-formatted JSON string :param data: the object to convert to JSON :return: A pretty-formatted JSON string
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L665-L682
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.show_report
def show_report(self, session, *levels): """ Shows the report that has been generated """ if levels: self.make_report(session, *levels) if self.__report: session.write_line(self.to_json(self.__report)) else: session.write_line("No repo...
python
def show_report(self, session, *levels): """ Shows the report that has been generated """ if levels: self.make_report(session, *levels) if self.__report: session.write_line(self.to_json(self.__report)) else: session.write_line("No repo...
Shows the report that has been generated
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L684-L694
tcalmant/ipopo
pelix/shell/report.py
_ReportCommands.write_report
def write_report(self, session, filename): """ Writes the report in JSON format to the given file """ if not self.__report: session.write_line("No report to write down") return try: with open(filename, "w+") as out_file: out_fi...
python
def write_report(self, session, filename): """ Writes the report in JSON format to the given file """ if not self.__report: session.write_line("No report to write down") return try: with open(filename, "w+") as out_file: out_fi...
Writes the report in JSON format to the given file
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/report.py#L696-L708
tcalmant/ipopo
pelix/remote/transport/mqtt_rpc.py
_MqttCallableProxy.handle_result
def handle_result(self, result, error): """ The result has been received :param result: Call result :param error: Error message """ if not self._error and not self._result: # Store results, if not already set self._error = error self._...
python
def handle_result(self, result, error): """ The result has been received :param result: Call result :param error: Error message """ if not self._error and not self._result: # Store results, if not already set self._error = error self._...
The result has been received :param result: Call result :param error: Error message
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/transport/mqtt_rpc.py#L301-L314
tcalmant/ipopo
samples/hooks/hook_provider.py
EventListenerHookImpl.event
def event(self, service_event, listener_dict): """ A service has been received: this method can alter the list of listeners to be notified of this event (remove only). It can also be used as a handler for the event that will be called before any standard one. :param serv...
python
def event(self, service_event, listener_dict): """ A service has been received: this method can alter the list of listeners to be notified of this event (remove only). It can also be used as a handler for the event that will be called before any standard one. :param serv...
A service has been received: this method can alter the list of listeners to be notified of this event (remove only). It can also be used as a handler for the event that will be called before any standard one. :param service_event: The ServiceEvent being triggered :param listener...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/samples/hooks/hook_provider.py#L63-L94
tcalmant/ipopo
docs/_static/tutorials/spell_checker/main_pelix_launcher.py
main
def main(): """ Starts a Pelix framework and waits for it to stop """ # Prepare the framework, with iPOPO and the shell console # Warning: we only use the first argument of this method, a list of bundles framework = pelix.framework.create_framework(( # iPOPO "pelix.ipopo.core", ...
python
def main(): """ Starts a Pelix framework and waits for it to stop """ # Prepare the framework, with iPOPO and the shell console # Warning: we only use the first argument of this method, a list of bundles framework = pelix.framework.create_framework(( # iPOPO "pelix.ipopo.core", ...
Starts a Pelix framework and waits for it to stop
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/docs/_static/tutorials/spell_checker/main_pelix_launcher.py#L15-L61
tcalmant/ipopo
pelix/misc/ssl_wrap.py
wrap_socket
def wrap_socket(socket, certfile, keyfile, password=None): """ Wraps an existing TCP socket and returns an SSLSocket object :param socket: The socket to wrap :param certfile: The server certificate file :param keyfile: The server private key file :param password: Password for the private key fi...
python
def wrap_socket(socket, certfile, keyfile, password=None): """ Wraps an existing TCP socket and returns an SSLSocket object :param socket: The socket to wrap :param certfile: The server certificate file :param keyfile: The server private key file :param password: Password for the private key fi...
Wraps an existing TCP socket and returns an SSLSocket object :param socket: The socket to wrap :param certfile: The server certificate file :param keyfile: The server private key file :param password: Password for the private key file (Python >= 3.3) :return: The wrapped socket :raise SSLError:...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/ssl_wrap.py#L54-L139
tcalmant/ipopo
pelix/http/__init__.py
make_html_list
def make_html_list(items, tag="ul"): # type: (Iterable[Any], str) -> str """ Makes a HTML list from the given iterable :param items: The items to list :param tag: The tag to use (ul or ol) :return: The HTML list code """ html_list = "\n".join( '<li><a href="{0}">{0}</a></li>'.fo...
python
def make_html_list(items, tag="ul"): # type: (Iterable[Any], str) -> str """ Makes a HTML list from the given iterable :param items: The items to list :param tag: The tag to use (ul or ol) :return: The HTML list code """ html_list = "\n".join( '<li><a href="{0}">{0}</a></li>'.fo...
Makes a HTML list from the given iterable :param items: The items to list :param tag: The tag to use (ul or ol) :return: The HTML list code
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/http/__init__.py#L132-L144
tcalmant/ipopo
pelix/http/__init__.py
AbstractHTTPServletRequest.read_data
def read_data(self): # type: () -> ByteString """ Reads all the data in the input stream :return: The read data """ try: size = int(self.get_header("content-length")) except (ValueError, TypeError): size = -1 return self.get_rfile...
python
def read_data(self): # type: () -> ByteString """ Reads all the data in the input stream :return: The read data """ try: size = int(self.get_header("content-length")) except (ValueError, TypeError): size = -1 return self.get_rfile...
Reads all the data in the input stream :return: The read data
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/http/__init__.py#L243-L255
tcalmant/ipopo
pelix/http/__init__.py
AbstractHTTPServletResponse.send_content
def send_content( self, http_code, content, mime_type="text/html", http_message=None, content_length=-1, ): # type: (int, str, str, str, int) -> None """ Utility method to send the given content as an answer. You can still use get_wfile...
python
def send_content( self, http_code, content, mime_type="text/html", http_message=None, content_length=-1, ): # type: (int, str, str, str, int) -> None """ Utility method to send the given content as an answer. You can still use get_wfile...
Utility method to send the given content as an answer. You can still use get_wfile or write afterwards, if you forced the content length. If content_length is negative (default), it will be computed as the length of the content; if it is positive, the given value will be used; ...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/http/__init__.py#L335-L380
tcalmant/ipopo
pelix/remote/discovery/multicast.py
make_mreq
def make_mreq(family, address): """ Makes a mreq structure object for the given address and socket family. :param family: A socket family (AF_INET or AF_INET6) :param address: A multicast address (group) :raise ValueError: Invalid family or address """ if not address: raise ValueErr...
python
def make_mreq(family, address): """ Makes a mreq structure object for the given address and socket family. :param family: A socket family (AF_INET or AF_INET6) :param address: A multicast address (group) :raise ValueError: Invalid family or address """ if not address: raise ValueErr...
Makes a mreq structure object for the given address and socket family. :param family: A socket family (AF_INET or AF_INET6) :param address: A multicast address (group) :raise ValueError: Invalid family or address
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/discovery/multicast.py#L151-L184
tcalmant/ipopo
pelix/remote/discovery/multicast.py
create_multicast_socket
def create_multicast_socket(address, port): """ Creates a multicast socket according to the given address and port. Handles both IPv4 and IPv6 addresses. :param address: Multicast address/group :param port: Socket port :return: A tuple (socket, listening address) :raise ValueError: Invalid ...
python
def create_multicast_socket(address, port): """ Creates a multicast socket according to the given address and port. Handles both IPv4 and IPv6 addresses. :param address: Multicast address/group :param port: Socket port :return: A tuple (socket, listening address) :raise ValueError: Invalid ...
Creates a multicast socket according to the given address and port. Handles both IPv4 and IPv6 addresses. :param address: Multicast address/group :param port: Socket port :return: A tuple (socket, listening address) :raise ValueError: Invalid address or port
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/discovery/multicast.py#L190-L263
tcalmant/ipopo
pelix/remote/discovery/multicast.py
close_multicast_socket
def close_multicast_socket(sock, address): """ Cleans up the given multicast socket. Unregisters it of the multicast group. Parameters should be the result of create_multicast_socket :param sock: A multicast socket :param address: The multicast address used by the socket """ if sock is...
python
def close_multicast_socket(sock, address): """ Cleans up the given multicast socket. Unregisters it of the multicast group. Parameters should be the result of create_multicast_socket :param sock: A multicast socket :param address: The multicast address used by the socket """ if sock is...
Cleans up the given multicast socket. Unregisters it of the multicast group. Parameters should be the result of create_multicast_socket :param sock: A multicast socket :param address: The multicast address used by the socket
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/discovery/multicast.py#L266-L293
tcalmant/ipopo
samples/rsa/helloimpl.py
HelloImpl.sayHello
def sayHello(self, name="Not given", message="nothing"): """ Synchronous implementation of IHello.sayHello synchronous method. The remote calling thread will be blocked until this is executed and responds. """ print( "Python.sayHello called by: {0} " ...
python
def sayHello(self, name="Not given", message="nothing"): """ Synchronous implementation of IHello.sayHello synchronous method. The remote calling thread will be blocked until this is executed and responds. """ print( "Python.sayHello called by: {0} " ...
Synchronous implementation of IHello.sayHello synchronous method. The remote calling thread will be blocked until this is executed and responds.
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/samples/rsa/helloimpl.py#L25-L38
tcalmant/ipopo
samples/rsa/helloimpl.py
HelloImpl.sayHelloAsync
def sayHelloAsync(self, name="Not given", message="nothing"): """ Implementation of IHello.sayHelloAsync. This method will be executed via some thread, and the remote caller will not block. This method should return either a String result (since the return type of IHello....
python
def sayHelloAsync(self, name="Not given", message="nothing"): """ Implementation of IHello.sayHelloAsync. This method will be executed via some thread, and the remote caller will not block. This method should return either a String result (since the return type of IHello....
Implementation of IHello.sayHelloAsync. This method will be executed via some thread, and the remote caller will not block. This method should return either a String result (since the return type of IHello.sayHelloAsync is CompletableFuture<String>, OR a Future that returns a pyt...
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/samples/rsa/helloimpl.py#L40-L56
tcalmant/ipopo
samples/rsa/helloimpl.py
HelloImpl.sayHelloPromise
def sayHelloPromise(self, name="Not given", message="nothing"): """ Implementation of IHello.sayHelloPromise. This method will be executed via some thread, and the remote caller will not block. """ print( "Python.sayHelloPromise called by: {0} " "w...
python
def sayHelloPromise(self, name="Not given", message="nothing"): """ Implementation of IHello.sayHelloPromise. This method will be executed via some thread, and the remote caller will not block. """ print( "Python.sayHelloPromise called by: {0} " "w...
Implementation of IHello.sayHelloPromise. This method will be executed via some thread, and the remote caller will not block.
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/samples/rsa/helloimpl.py#L58-L71
tcalmant/ipopo
pelix/ipopo/core.py
_set_factory_context
def _set_factory_context(factory_class, bundle_context): # type: (type, Optional[BundleContext]) -> Optional[FactoryContext] """ Transforms the context data dictionary into its FactoryContext object form. :param factory_class: A manipulated class :param bundle_context: The class bundle context ...
python
def _set_factory_context(factory_class, bundle_context): # type: (type, Optional[BundleContext]) -> Optional[FactoryContext] """ Transforms the context data dictionary into its FactoryContext object form. :param factory_class: A manipulated class :param bundle_context: The class bundle context ...
Transforms the context data dictionary into its FactoryContext object form. :param factory_class: A manipulated class :param bundle_context: The class bundle context :return: The factory context, None on error
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/core.py#L85-L107
tcalmant/ipopo
pelix/ipopo/core.py
_load_bundle_factories
def _load_bundle_factories(bundle): # type: (Bundle) -> List[Tuple[FactoryContext, type]] """ Retrieves a list of pairs (FactoryContext, factory class) with all readable manipulated classes found in the bundle. :param bundle: A Bundle object :return: The list of factories loaded from the bundle...
python
def _load_bundle_factories(bundle): # type: (Bundle) -> List[Tuple[FactoryContext, type]] """ Retrieves a list of pairs (FactoryContext, factory class) with all readable manipulated classes found in the bundle. :param bundle: A Bundle object :return: The list of factories loaded from the bundle...
Retrieves a list of pairs (FactoryContext, factory class) with all readable manipulated classes found in the bundle. :param bundle: A Bundle object :return: The list of factories loaded from the bundle
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/core.py#L110-L150
tcalmant/ipopo
pelix/ipopo/core.py
_IPopoService.__find_handler_factories
def __find_handler_factories(self): """ Finds all registered handler factories and stores them """ # Get the references svc_refs = self.__context.get_all_service_references( handlers_const.SERVICE_IPOPO_HANDLER_FACTORY ) if svc_refs: for sv...
python
def __find_handler_factories(self): """ Finds all registered handler factories and stores them """ # Get the references svc_refs = self.__context.get_all_service_references( handlers_const.SERVICE_IPOPO_HANDLER_FACTORY ) if svc_refs: for sv...
Finds all registered handler factories and stores them
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/core.py#L206-L217
tcalmant/ipopo
pelix/ipopo/core.py
_IPopoService.__add_handler_factory
def __add_handler_factory(self, svc_ref): # type: (ServiceReference) -> None """ Stores a new handler factory :param svc_ref: ServiceReference of the new handler factory """ with self.__handlers_lock: # Get the handler ID handler_id = svc_ref.get_...
python
def __add_handler_factory(self, svc_ref): # type: (ServiceReference) -> None """ Stores a new handler factory :param svc_ref: ServiceReference of the new handler factory """ with self.__handlers_lock: # Get the handler ID handler_id = svc_ref.get_...
Stores a new handler factory :param svc_ref: ServiceReference of the new handler factory
https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/core.py#L219-L248