def _conicConnect(self): if self.conicConnection is None: self.conicConnection = conic.Connection() self.conicConnection.connect("connection-event", self._connectionStateCB) self.conicConnection.set_property("automatic-connection-events", True)
def connect(): global magic print "connect():" # Creates the connection object and attach the handler. connection = conic.Connection() iaps = connection.get_all_iaps() iap = None for i in iaps: #Replace with your IAP name if i.get_name() == "MYAPNAME": iap = i connection.connect("connection-event", connection_cb, magic) # The request_connection method should be called to initialize # some fields of the instance if not iap: assert (connection.request_connection(conic.CONNECT_FLAG_NONE)) else: print "Getting by iap %s", iap.get_id() assert (connection.request_connection_by_id(iap.get_id(), conic.CONNECT_FLAG_NONE)) return False
def start(): print "start():" connection = conic.Connection() connection.connect("connection-event", connection_cb) connection.set_property("automatic-connection-events", True) return connection
def connect(): connection = conic.Connection() connection.connect("connection-event", connection_cb) assert (connection.request_connection(conic.CONNECT_FLAG_NONE)) return False
def start(): print "start():" connection = conic.Connection() connection.connect("connection-event", connection_cb, 0xFFAA) connection.connect("statistics", statistics_cb, 0x55AA) connection.request_connection(conic.CONNECT_FLAG_NONE) return False
def start(loop): print "(start)" connection = conic.Connection() connection.connect("connection-event", connection_cb, loop) connection.request_connection(conic.CONNECT_FLAG_NONE) return False
def connect2(loop): print "connect2" connection = conic.Connection() connection.connect("connection-event", connection_cb2, 0xFAE0) connection.request_connection(conic.CONNECT_FLAG_NONE) return False
def connect1(loop): print "connect1" connection = conic.Connection() connection.connect("connection-event", connection_cb, 0xAA55) connection.set_property("automatic-connection-events", True) return False
def start(loop): print "(start)" connection = conic.Connection() test_all_iaps(connection, loop) test_get_iap(connection) return False
def connect(loop): global magic connection = conic.Connection() connection.connect("connection-event", connection_cb, magic, loop) # Needed to associate the instance to the current connection assert (connection.request_connection(conic.CONNECT_FLAG_NONE)) return False
def __init__(self, app, h_window, h_context): self._app = app self._h_window = h_window self._h_context = h_context state = osso.DeviceState(self._h_context) state.set_device_state_callback(self._device_state_cb) con = conic.Connection() con.connect('connection-event', self._connection_cb) if not con.request_connection(conic.CONNECT_FLAG_NONE): logging.debug("error with conic connection thingy")
def connect(): global magic print "connect():" # Creates the connection object and attach the handler. connection = conic.Connection() connection.connect("connection-event", connection_cb, magic) # The request_connection method should be called to initialize # some fields of the instance assert (connection.request_connection(conic.CONNECT_FLAG_NONE)) return False
def request_connection(): """ If the device is not connected, tries to establish the default connection or pop up the connection dialog. Does nothing if the device does already have a network connection. @since: 0.96.3 """ # dbus-send --type=method_call --system --dest=com.nokia.icd/com/nokia/icd com.nokia.icd.connect # dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true try: import conic conn = conic.Connection() conn.request_connection(conic.CONNECT_FLAG_NONE) except: pass
def __init__(self, weboob): self.touch_selector_entry_filled = False self.refresh_in_progress = False self.connected = False self.weboob = weboob try: self.connection = conic.Connection() self.connection.connect("connection-event", self.connect_event) self.connection.set_property("automatic-connection-events", True) self.connection.request_connection(conic.CONNECT_FLAG_NONE) except NotImplementedError: pass horizontal_box = gtk.HBox() self.main_window = toolkit.Window() try: self.refresh_button = toolkit.Button( gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_HORIZONTAL, "Actualiser") self.retour_button = hildon.Button( gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_HORIZONTAL, "Retour") self.combo_source = hildon.TouchSelectorEntry(text=True) self.combo_dest = hildon.TouchSelectorEntry(text=True) self.picker_button_source = hildon.PickerButton( gtk.HILDON_SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL) self.picker_button_dest = hildon.PickerButton( gtk.HILDON_SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL) self.picker_button_source.set_sensitive(False) self.picker_button_dest.set_sensitive(False) self.picker_button_source.set_title("Gare de Depart") self.picker_button_dest.set_title("Gare d'arrivee") self.picker_button_source.set_selector(self.combo_source) self.picker_button_dest.set_selector(self.combo_dest) horizontal_box.pack_start(self.picker_button_source) horizontal_box.pack_start(self.picker_button_dest) except AttributeError: self.refresh_button = gtk.Button("Actualiser") self.retour_button = gtk.Button("Retour") self.combo_source = gtk.combo_box_entry_new_text() self.combo_dest = gtk.combo_box_entry_new_text() horizontal_box.pack_start(self.combo_source) horizontal_box.pack_start(self.combo_dest) self.main_window.set_title("Horaires des Prochains Trains") self.main_window.connect("destroy", self.on_main_window_destroy) self.refresh_button.connect("clicked", self.on_refresh_button_clicked) self.retour_button.set_sensitive(False) self.retour_button.connect("clicked", self.on_retour_button_clicked) self.treestore = gtk.TreeStore(str, str, str, str, str) treeview = gtk.TreeView(self.treestore) treeview.append_column( gtk.TreeViewColumn('Train', gtk.CellRendererText(), text=0)) treeview.append_column( gtk.TreeViewColumn('Horaire', gtk.CellRendererText(), text=1)) treeview.append_column( gtk.TreeViewColumn('Destination', gtk.CellRendererText(), text=2)) treeview.append_column( gtk.TreeViewColumn('Voie', gtk.CellRendererText(), text=3)) treeview.append_column( gtk.TreeViewColumn('Information', gtk.CellRendererText(), text=4)) vertical_box = gtk.VBox() vertical_box.pack_start(horizontal_box) horizontal_box.pack_start(self.retour_button) vertical_box.pack_start(treeview) vertical_box.pack_start(self.refresh_button) self.main_window.add(vertical_box) self.main_window.show_all() self.fill_touch_selector_entry() if toolkit != gtk: self.picker_button_source.connect("value-changed", self.check_station_input, self.picker_button_source) self.picker_button_dest.connect("value-changed", self.check_station_input, self.picker_button_dest)
def __init__(self): self.system_bus = dbus.Bus.get_system() self.icd_obj = self.system_bus.get_object(self.ICD_NAME, \ self.ICD_PATH) self.icd = dbus.Interface(self.icd_obj, self.ICD_INTF) self.conic = conic.Connection()
def __init__(self, apn): self.apn = apn self.current_connection() self.connection = conic.Connection()