def __init__(self, obj=None, event_type=None, *args): #Creates a new filter object QObject.__init__(self, *args) self.obj = obj self.event_type = event_type self.events_handled = 0 self.events_bypassed = 0
def __init__(self, url, connection=None): QObject.__init__(self) self._url = url self._conn = connection self._progress = 0. self._running = False self._result = ()
def __init__(self, game, path=None): if not (path and os.path.isfile(path)): path = 'maps/simple.json' QObject.__init__(self) self.game = game game.map = self spec = Map.read_spec(path) path = 'maps/' + spec['path'] with open(path) as data_map: tmp_map = data_map.read() self.map = [] self.bombs = 0 self.bombs_list = [] for y, line in enumerate(tmp_map.split('\n')): _line = [] for x, item in enumerate(line): block = Map.ELEM_BY_TYPE[item](self, y, x) _line.append(block) if not hasattr(self, 'initial_position') and type(block) is Space: self.initial_position = block.position self.cur_position = block.position self.cur_block = block if type(block) is Bomb: self.bombs += 1 self.bombs_list.append(block) self.map.append(_line) self.title = spec.get('title', spec['path']) self.background = spec.get('background', None) if self.background: self.background = 'maps/' + self.background
def __init__(self): QObject.__init__(self) self._mywindow = loadWindowFromFile(r'mainwindow.ui') self._mywindow.le_expires.setText("90") self._width_of_vm_frame = 400 self._connectWidgetSignals() self._progress_dlg = ProgressDialog()
def __init__(self, ntype, watcher, poller): QObject.__init__(self) self.watcher = watcher self.poller = poller self.stype = self._N[ntype] self.notifier = QSocketNotifier(watcher, ntype, self) self.notifier.activated.connect(self.dispatcher)
def __init__(self, options, outputFolder, scenario='vanet-highway-test-thomas'): QRunnable.__init__(self) QObject.__init__(self) self.options = '' self.optionsDict = options self.prate = options['prate'] #print self.optionsDict for option in options: if option=='vel1' or option=='spl': speedInMs = options[option].getValue()*1000/3600 self.options += ' --%s=%s' % (option, speedInMs) else: self.options += ' --%s=%s' % (option, options[option]) self.runNumber = random.randint(1,10000) #self.runNumber = 1 self.options += ' --rn=%d' % self.runNumber # randomize the results self.command = './waf' self.scenario = scenario self.outputFolder = outputFolder settings = {} for option in options: #self.output['settings'][option+'| '+self.options[option].getName()] = self.options[option].getValue() if option=='prate': settings[option] = options[option] else: settings[option] = options[option].getValue() self.output = {'scenario':scenario, 'settings':settings,'command':'%s %s%s' % (self.command, ' --run \'', self.scenario+self.options+'\'')}
def __init__(self,): QObject.__init__(self) self._running = False self._lock = None # Logging sync self.logger = logging.getLogger('KhtNotes') self.logger.setLevel(logging.DEBUG) handler = logging.handlers.RotatingFileHandler( os.path.expanduser('~/.khtnotes.sync.log'), maxBytes=500 * 1024, backupCount=1) formatter = \ logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") handler.setFormatter(formatter) self.logger.addHandler(handler) streamHandler = logging.StreamHandler() streamHandler.setLevel(logging.DEBUG) streamHandler.setFormatter(formatter) self.logger.addHandler(streamHandler) self._localDataFolder = Note.NOTESPATH if not os.path.exists(self._localDataFolder): os.mkdir(self._localDataFolder) self._remoteDataFolder = 'KhtNotes'
def __init__(self, syntax, object): if isinstance(object, QTextDocument): document = object elif isinstance(object, QTextEdit): document = object.document() assert document is not None else: raise TypeError("object must be QTextDocument or QTextEdit") QObject.__init__(self, document) self._syntax = syntax self._document = document # can't store references to block, Qt crashes if block removed self._pendingBlockNumber = None self._pendingAtLeastUntilBlockNumber = None document.contentsChange.connect(self._onContentsChange) charsAdded = document.lastBlock().position() + document.lastBlock( ).length() self._onContentsChange(0, 0, charsAdded, zeroTimeout=self._wasChangedJustBefore())
def __init__(self,): QObject.__init__(self,) self.thread = None self._balance = '<b>0.00</b>000000' self._fiatSymbol = u'€' self._fiatRate = 0 self._fiatBalance = u'0 €' self._wallet = Wallet() self._wallet.onNewTransaction.connect(self.notifyNewTx) self._walletUnlocked = False self.settings = Settings() self.addressesModel = AddressesModel() self.transactionsModel = TransactionsModel() self.timer = QTimer(self) self.timer.setInterval(900000) # 15 min update self.timer.timeout.connect(self.update) self.timer.start() if self.settings.storePassKey: self._currentPassKey = self.settings.passKey try: self.unlockWallet(self._currentPassKey) except: self.onError.emit('Stored pass phrase is invalid') else: self._currentPassKey = None self._currentAddressIndex = 0
def __init__(self, root): QObject.__init__(self) self.root = root self.context_menu_actions = [] self.episode_list_title = u'' self.current_input_dialog = None self.root.config.add_observer(self.on_config_changed)
def __init__(self, datapath): QObject.__init__(self) self.sub = None self.save_image = False self.camera_name = None self.cam = HRCamera() self.datapath = datapath
def __init__(self, manager, name): """ Perform minimal plugin initialization. """ QObject.__init__(self) self.manager = manager self.name = name self._is_active = False
def __init__(self, files, parent, multi_component=False): QObject.__init__(self) self.files = files self.parent_ = parent self.multi_component = multi_component if not self.multi_component: self.files = {db[files[0]]['component']: self.files}
def __init__(self, url, image_path): QObject.__init__(self) self.url = QUrl(url) self.image_path = image_path self.webpage = QWebPage(self) self.webpage.loadFinished.connect(self.render) self.webpage.mainFrame().load(self.url)
def __init__(self, filepath): QObject.__init__(self,) self._filename = os.path.basename(filepath) self._filepath = os.path.realpath(filepath) self._isdir = os.path.isdir(filepath) self._data = None self._ready = False
def __init__(self,datapath): QObject.__init__(self) self.sub=None self.save_image = False self.camera_name = None self.cam = HRCamera() self.datapath = datapath
def __init__(self,): QObject.__init__(self) self.config = ConfigParser.ConfigParser() if not os.path.exists(os.path.expanduser("~/.khtnotes.cfg")): self._write_default() else: self.config.read(os.path.expanduser("~/.khtnotes.cfg")) if not self.config.has_section("Favorites"): self.config.add_section("Favorites") self._write() # Added in 2.19 if not self.config.has_option("Webdav", "remoteFolder"): self.config.set("Webdav", "remoteFolder", "Notes") self._write() # Remove local sync index to prevent losing notes : if os.path.exists(os.path.join(NOTESPATH, ".index.sync")): os.remove(os.path.join(NOTESPATH, ".index.sync")) # Added in 2.20 if not self.config.has_option("Display", "displayHeader"): self.config.set("Display", "displayHeader", "true") self._write() # Added in 3.0 if not self.config.has_option("Keyboard", "hideVkb"): self.config.add_section("Keyboard") self.config.set("Keyboard", "hideVkb", "true") self._write() if not self.config.has_option("Webdav", "autoSync"): self.config.set("Webdav", "autoSync", "false") self._write()
def __init__(self): QObject.__init__(self) # Indicates that the animation is paused in between self.__paused = False # Indicates that the animation have been started self.__started = False # Indicates that the animation is currently running self.__running = False # Indicates that the animation can be run in reverse self.__run_reversed = False # Indicate that the animation is canceled self.__cancel = False # Indicates that the animation is ended self.__end = False # Stores the start delay of the animation in seconds self.__start_delay = 0 # Stores the duration in which the animation should be completed self.__duration = 0 # Holds the shapes to which animation should be applied self.__shapes = [] # Framerate of the animation self.__fps = 60
def __init__(self, qApplication): QObject.__init__(self) self.application = qApplication self.application.aboutToQuit.connect(self.__beforeQuitting) self.uiLoader = QUiLoader() # Need to set working directory in order to load icons self.uiLoader.setWorkingDirectory(UI_PATH) self.uiLoader.registerCustomWidget(ObsLightGuiMainWindow) self.uiLoader.registerCustomWidget(ObsLightGuiProgressDialog) # loaded in loadManager() self.splash = None self.__obsLightManager = None self.__obsProjectManager = None self.__micProjectsManager = None self.__logManager = None # loaded in __loadMainWindow() self.__mainWindow = None self.__mainWindowActionManager = None self.__statusBar = None # loaded in __createInfiniteProgressDialog() self.__infiniteProgress = None # loaded in __createProgressDialog() self.__progress = None # loaded in runWizard() self.__wizard = None
def __init__(self,): QObject.__init__(self) self._running = False #logging.getLogger(_defaultLoggerName).setLevel(logging.WARNING) self.logger = logger.getDefaultLogger() self._localDataFolder = Note.NOTESPATH self._remoteDataFolder = 'KhtNotes'
def __init__(self, ): QObject.__init__(self) if not os.path.exists(Note.NOTESPATH): try: os.mkdir(Note.NOTESPATH) except Exception, e: print 'Can t create note storage folder', str(e)
def __init__(self, ): QObject.__init__(self) self._settings = QSettings() self._token = '' self._timeremaining = '' self._serial = '' if self._settings.contains('REGION'): self._region = self._settings.value('REGION') if self._region not in ('EU', 'US'): self._set_region('US') else: self._region = 'US' if self._settings.contains('SECRET'): self._secret = unhexlify(self._settings.value('SECRET')) if not self._secret: self.new_serial() else: self.new_serial() if not self._serial: if self._settings.contains('SERIAL'): self._serial = self._settings.value('SERIAL') if self._token == '': self.sync()
def __init__(self, adapterName=None, parent=None): QObject.__init__(self, parent) dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) self._devices = {} self._devPathToAddress = {} self._bus = dbus.SystemBus() self._manager = dbus.Interface(self._bus.get_object("org.bluez", "/"), "org.bluez.Manager") adapter = None if adapterName: try: adapter = self._manager.FindAdapter(adapterName) except: print "Adaper %s not found" % adapterName if not adapter: print "Using default adapter" adapter = self._manager.DefaultAdapter() self._adapter = dbus.Interface(self._bus.get_object("org.bluez", adapter), "org.bluez.Adapter") self._bus.add_signal_receiver(self._onDeviceFound, dbus_interface = "org.bluez.Adapter", signal_name = "DeviceFound") self._bus.add_signal_receiver(self._onDeviceDisappeared, dbus_interface = "org.bluez.Adapter", signal_name = "DeviceDisappeared")
def __init__(self, args, gpodder_core, dbus_bus_name): QObject.__init__(self) self.dbus_bus_name = dbus_bus_name # TODO: Expose the same D-Bus API as the Gtk UI D-Bus object (/gui) # TODO: Create a gpodder.dbusproxy.DBusPodcastsProxy object (/podcasts) self.app = QApplication(args) signal.signal(signal.SIGINT, signal.SIG_DFL) self.quit.connect(self.on_quit) self.core = gpodder_core self.config = self.core.config self.db = self.core.db self.model = self.core.model self.config_proxy = ConfigProxy(self.config) # Initialize the gpodder.net client self.mygpo_client = my.MygPoClient(self.config) gpodder.user_extensions.on_ui_initialized(self.model, self.extensions_podcast_update_cb, self.extensions_episode_download_cb )
def __init__(self,): QObject.__init__(self,) self.config = ConfigParser.ConfigParser() if not os.path.exists(os.path.expanduser('~/.khtsimpletext.cfg')): self._write_default() else: self.config.read(os.path.expanduser('~/.khtsimpletext.cfg'))
def __init__(self, files, parent, multi_component=False): QObject.__init__(self) self.files = files self.parent_ = parent self.multi_component = multi_component if not self.multi_component: self.files = { db[files[0]]['component'] : self.files }
def __init__(self): QObject.__init__(self) self.__ui = None self.__setup_ui() self.__model = EditorModel() self.__current_model_position = EditorModelPositionner() self.__current_file = None
def __init__(self, athlete): ''' Constructor ''' QObject.__init__(self) self.pushupCreation_Dialog = PushupForm(athlete) self.pushupCreation_Dialog.pushupCreated.connect(self.storePushup)
def __init__(self, map): QObject.__init__(self) self.map = map self.map.put_robot(self) self.start.connect(self._start) self.move.connect(self._move) self.stop = False self.moves = 0
def __init__(self, x, y, r): # Initialize the Circle as a QObject so it can emit signals QObject.__init__(self) # "Hide" the values and expose them via properties self._x = x self._y = y self._r = r
def __init__(self, host, port): Thread.__init__(self) QObject.__init__(self) self.socket=socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.connect((host,port)) self.socket.settimeout(.5) self.setDaemon(True)
def __init__(self): QObject.__init__(self) self._thread = QThread() self.moveToThread(self._thread) self._thread.started.connect(self.start) self._ev = Event() self._app = None self._thread.start()
def __init__(self): QObject.__init__(self) self.manager = QOrganizerManager("memory") self._todos = [] # FIXME Use a model instead of a string list as model self._todo = None # Current todo being edited or created self.reload()
def __init__(self, host, port): Thread.__init__(self) QObject.__init__(self) self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.connect((host, port)) self.socket.settimeout(.5) self.setDaemon(True)
def __init__(self, manager, info): """ Perform minimal plugin initialization. """ QObject.__init__(self) self._manager = manager self._info = info self._name = info.name self._is_active = False
def __init__(self, *args, **kwargs): QObject.__init__(self, *args, **kwargs) self._stop = Event() self._stop.set() self.thread = None self.proc = None self.bin_dir = os.path.dirname(os.path.realpath(__file__)) print "bin_dir", self.bin_dir
def __init__(self, projectListWidget, projectListFunc): """ Initialize a ProjectsManagerBase with: projectListWidget: a QListWidget instance where the projects will be loaded projectListFunc: a function returning a list of project names """ QObject.__init__(self) self.__projectListFunc = projectListFunc self.__projectListWidget = projectListWidget
def __init__(self, root): QObject.__init__(self) self.root = root self.context_menu_actions = [] self.episode_list_title = u'' self.current_input_dialog = None self.root.config.add_observer(self.on_config_changed) self._flattr = self.root.core.flattr self.flattr_button_text = u''
def __init__(self): ''' Constructor ''' QObject.__init__(self) self.profileCreationDialog = ProfileCreationWidget() self.profileCreationDialog.profileCreated.connect(self.storeProfile) self.profileCreationDialog.buttonBox.rejected.connect(self.reject)
def __init__(self, fuchia_database): QObject.__init__(self) self._fuchia_database = fuchia_database self._arv_started = ArvStartedPatients(self._fuchia_database) self._report_widget = None self._start_date = None self._end_date = None self.last_values = OrderedDict() self.last_template_values = {}
def __init__(self): # "foobar" will become a object attribute that will not be # listed on the among the type attributes. Thus for bug # condition be correctly triggered the "foobar" attribute # must not previously exist in the parent class. self.foobar = None # The parent __init__ method must be called after the # definition of "self.foobar". QObject.__init__(self)
def __init__(self, monitor, parent=None): """ Observe the given ``monitor`` (a :class:`~pyudev.Monitor`): ``parent`` is the parent :class:`~PySide.QtCore.QObject` of this object. It is passed unchanged to the inherited constructor of :class:`~PySide.QtCore.QObject`. """ QObject.__init__(self, parent) self._setup_notifier(monitor, QSocketNotifier)
def __init__(self, db, podcast_list_model, title, description, eql=None): QObject.__init__(self) self.db = db self.podcast_list_model = podcast_list_model self.title = title self.description = description self.eql = eql self.pause_subscription = False self._new_count = -1 self._downloaded_count = -1
def __init__(self, seconds): ''' Constructeur. - seconds : Nombre de secondes après lesquelles un signal est lancé. ''' threading.Thread.__init__(self) QObject.__init__(self) self._running = seconds > 0.0 self._delay = seconds
def __init__(self, qpart): QObject.__init__(self, qpart) self._qpart = qpart self._widget = None self._completionOpenedManually = False self._wordSet = None qpart.installEventFilter(self) qpart.textChanged.connect(self._onTextChanged)
def __init__(self, gui): QObject.__init__(self) ObsLightGuiObject.__init__(self, gui) self.__chrootFileManager = PackageSourceFileManager(gui, self.manager) self.__packageSourceFileManager = ChrootFileManager(gui, self.manager) self.__SpecEditorManager = SpecEditorManager(gui, self.manager) self.__project = None self.__package = None
def __init__(self): QObject.__init__(self) self._services = [] self._errorMessage = "" self._emailEnabled = False self._addressEnabled = True self.manager = QServiceManager(self) self.reloadServicesList()
def __init__(self, parent, reactor, watcher, socketType): QObject.__init__(self, parent) self.reactor = reactor self.watcher = watcher fd = watcher.fileno() self.notifier = QSocketNotifier(fd, socketType, parent) self.notifier.setEnabled(True) if socketType == QSocketNotifier.Read: self.fn = self.read else: self.fn = self.write QObject.connect(self.notifier, SIGNAL("activated(int)"), self.fn)
def __init__(self, gui): """ Initialise the LogManager. `gui` must be a reference to the main `Gui` instance. """ QObject.__init__(self) ObsLightGuiObject.__init__(self, gui) self.__logDialog = self.gui.loadWindow(u"obsLightLog.ui", mainWindowAsParent=False) self.__logTextEdit = self.__logDialog.logTextEdit self.__myHandler = None self.customizeFont() self.connectLogger()
def __init__(self, root): QObject.__init__(self) self.root = root self.context_menu_actions = [] self.episode_list_title = u'' self.current_input_dialog = None self.root.config.add_observer(self.on_config_changed) self._flattr = self.root.core.flattr self.flattr_button_text = u'' self._busy = False self.updating_podcasts = 0 self.current_episode = None self._subscribe_in_progress = False