Beispiel #1
0
 def __init__ (self, secs, gain, bsecs=-1, minutes=-1):
     GObject.__init__(self)
     
     if bsecs < 0: bsecs = secs
     if minutes < 0:
         minutes = secs / 60
     self.minutes = minutes  # The number of minutes for the original starting
         # time control (not necessarily where the game was resumed,
         # i.e. self.intervals[0][0])
     self.intervals = [[secs],[bsecs]]
     self.gain = gain
     
     self.paused = False
     # The left number of secconds at the time pause was turned on
     self.pauseInterval = 0
     self.counter = None
     
     self.started = False
     self.ended = False
     
     self.movingColor = WHITE
     
     self.connect('time_changed', self.__zerolistener, 'time_changed')
     self.connect('player_changed', self.__zerolistener, 'player_changed')
     self.connect('pause_changed', self.__zerolistener, 'pause_changed')
     self.heap = []
Beispiel #2
0
    def __init__(self, plugin, frame):
        GObject.__init__(self)
        PropertyObject.__init__(self)
        log.debug('Initializing FreezeFrame ' + frame)
        
        self.plugin = plugin 
        self._frame = frame
		
        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._queue_cbs = []
        self._obd_cbs = []
        
        if plugin.app.prefs.get('imperial', False):
            self._unit_standard = 'Imperial'
        else:
            self._unit_standard = 'Metric'
            
        cb_id = plugin.app.prefs.add_watch('imperial', 
                                    self._notify_units_cb)
        self._pref_cbs.append(('imperial', cb_id))
        
        self._setup_gui()
        self._setup_sensors()
        self._get_supported_pids()
Beispiel #3
0
    def __init__(self, func):
        """ Initialize a new GtkWorker around a specific function """
        GObject.__init__(self)
        Thread.__init__(self)

        # By some reason we cannot access __gsignals__, so we have to do a
        # little double work here
        self.connections = {"progressed": 0, "published": 0, "done": 0}
        self.handler_ids = {}

        self.func = func
        self.cancelled = False
        self.done = False
        self.progress = 0

        ########################################################################
        # Publish and progress queues                                          #
        ########################################################################

        self.publisher = EmitPublisher(self, "published", Publisher.SEND_LIST)
        self.publisher.start()

        self.progressor = EmitPublisher(self, "progressed",
                                        Publisher.SEND_LAST)
        self.progressor.start()
Beispiel #4
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from GUI.Manager import Manager
		Manager(self, editor)
		from Loader import Loader
		Loader(self, editor)
Beispiel #5
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from SmartSpace import SmartSpace
		SmartSpace(editor, self)
		from ConfigurationManager import Manager
		Manager(editor, self)
Beispiel #6
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from FileInfo import FileInfo
     FileInfo(self, editor)
     from Window import Window
     Window(self, editor)
     from NameLabel import Label
     Label(self, editor)
     from TypeLabel import Label
     Label(self, editor)
     from SizeLabel import Label
     Label(self, editor)
     from LocationLabel import Label
     Label(self, editor)
     from MIMELabel import Label
     Label(self, editor)
     from LinesLabel import Label
     Label(self, editor)
     from WordsLabel import Label
     Label(self, editor)
     from CharactersLabel import Label
     Label(self, editor)
     from ModifiedLabel import Label
     Label(self, editor)
     from AccessedLabel import Label
     Label(self, editor)
Beispiel #7
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from GUI.Manager import Manager
     Manager(self, editor)
     from Loader import Loader
     Loader(self, editor)
Beispiel #8
0
 def __init__(self, obd_device):
     """ @param obd_device: the OBDDevice to send commands
         @param timeout: the time between two commands
     """
     GObject.__init__(self)
     PropertyObject.__init__(self, obd_device=obd_device)
     self._queue = []
     self._os_queue = []
Beispiel #9
0
 def __init__(self, obd_device):
     """ @param obd_device: the OBDDevice to send commands
         @param timeout: the time between two commands
     """
     GObject.__init__(self)
     PropertyObject.__init__(self, obd_device=obd_device)
     self._queue = []
     self._os_queue = []
Beispiel #10
0
	def __init__(self, manager, editor):
		GObject.__init__(self)
		self.__init_attributes(manager, editor)
		self.__signal_id_1 = self.__manager.connect("abbreviations-updated", self.__manager_abbreviations_updated_cb)
		self.__signal_id_2 = self.__manager.connect("destroy", self.__monitor_destroy_cb)
		self.__signal_id_3 = self.__editor.textview.connect("key-press-event", self.__monitor_key_press_event_cb)
		if self.__can_monitor is False:
			self.__editor.textview.handle_block(self.__signal_id_3)
Beispiel #11
0
	def __init__(self, editor):
		GObject.__init__(self)
		from Generator import Generator
		Generator(self, editor)
		from ..SupportedEncodings.EncodingListDispatcher import Dispatcher
		Dispatcher(self, editor)
		from ..SupportedEncodings.EncodingListDatabaseMonitor import Monitor
		Monitor(self, editor)
Beispiel #12
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from WhitespaceDrawer import Drawer
		Drawer(editor, self)
		from DatabaseReader import Reader
		Reader(self, editor)
		from DatabaseMonitor import Monitor
		Monitor(self, editor)
Beispiel #13
0
    def __init__(self, device):
        """ @param device: the OBDDevice to send commands
            @param timeout: the time between two commands
        """
        GObject.__init__(self)
        PropertyObject.__init__(self, device=device)
        self._queue = []

        self._working = False
Beispiel #14
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from Updater import Updater
     Updater(editor, self)
     from TreeView import TreeView
     TreeView(editor, self)
     from Window import Window
     Window(editor, self)
Beispiel #15
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from Window import Window
		Window(editor, self)
		from TreeView import TreeView
		TreeView(editor, self)
		from Updater import Updater
		Updater(self, editor)
Beispiel #16
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from WhitespaceDrawer import Drawer
     Drawer(editor, self)
     from DatabaseReader import Reader
     Reader(self, editor)
     from DatabaseMonitor import Monitor
     Monitor(self, editor)
Beispiel #17
0
 def __init__(self, manager, editor):
     GObject.__init__(self)
     self.__init_attributes(manager, editor)
     self.__sigid1 = manager.connect("destroy", self.__destroy_cb)
     from DatabaseUpdater import Updater
     Updater(self, editor)
     from CheckButton import Button
     Button(self, editor)
     from DatabaseListener import Listener
     Listener(self, editor)
Beispiel #18
0
	def __init__(self, manager, editor):
		GObject.__init__(self)
		self.__init_attributes(manager, editor)
		self.__sigid1 = manager.connect("destroy", self.__destroy_cb)
		from DatabaseUpdater import Updater
		Updater(self, editor)
		from CheckButton import Button
		Button(self, editor)
		from DatabaseListener import Listener
		Listener(self, editor)
Beispiel #19
0
 def __init__(self, queue):
     GObject.__init__(self)
     PropertyObject.__init__(self)
     
     self._rate = 0
     self._samples = []
     self.set_text(_('command rate: N/A'))
     
     queue.connect('command_executed', self._queue_command_executed_cb)
     queue.connect('notify::working', self._queue_notify_working_cb)
Beispiel #20
0
 def __init__(self, scheduler):
     GObject.__init__(self)
     PropertyObject.__init__(self)
     
     self._rate = 0
     self._samples = []
     self.set_text(_('refresh rate: N/A'))
     
     scheduler.connect('command_executed', self._scheduler_command_executed_cb)
     scheduler.connect('notify::working', self._scheduler_notify_working_cb)
Beispiel #21
0
 def __init__(self):
     GObject.__init__(self)
     from IndexerProcessMonitor import Monitor
     Monitor(self)
     from DBusService import DBusService
     DBusService(self)
     from DictionaryGenerator import Generator
     Generator(self)
     from JobSpooler import Spooler
     Spooler(self)
	def __init__(self):
		GObject.__init__(self)
		from IndexerProcessMonitor import Monitor
		Monitor(self)
		from DBusService import DBusService
		DBusService(self)
		from DictionaryGenerator import Generator
		Generator(self)
		from JobSpooler import Spooler
		Spooler(self)
    def __init__(self):
        GObject.__init__(self)

        self.tags = []
        self.selected_tags = []
        self.search = None

        for i in range(TAGS_LAST):
            self.tags.append({})
            self.selected_tags.append([])
Beispiel #24
0
    def __init__(self, glade):
        GObject.__init__(self)
        PropertyObject.__init__(self)

        self._code_label = glade.get_widget('code_label')
        self._class_label = glade.get_widget('class_label')
        self._description_label = glade.get_widget('description_label')
        self._additional_textview = glade.get_widget('additional_textview')
    
        self._additional_buffer = gtk.TextBuffer()
        self._additional_textview.set_buffer(self._additional_buffer)
Beispiel #25
0
    def __init__(self, scheduler):
        GObject.__init__(self)
        PropertyObject.__init__(self)

        self._rate = 0
        self._samples = []
        self.set_text(_('refresh rate: N/A'))

        scheduler.connect('command_executed',
                          self._scheduler_command_executed_cb)
        scheduler.connect('notify::working', self._scheduler_notify_working_cb)
Beispiel #26
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from GUI.Manager import Manager
     Manager(self, editor)
     from EncodingListDispatcher import Dispatcher
     Dispatcher(self, editor)
     from EncodingListDatabaseMonitor import Monitor
     Monitor(self, editor)
     from EncodingListDatabaseUpdater import Updater
     Updater(self, editor)
Beispiel #27
0
    def __init__(self, app):
        GObject.__init__(self)

        self.app = app
        self._config = ConfigParser()
        self._filename = os.path.join(save_config_path("garmon"), "config")
        self._config.read(self._filename)
        
        self._dialog = _PrefsDialog()
        
        self._watches = []
Beispiel #28
0
    def __init__(self, builder):
        GObject.__init__(self)
        PropertyObject.__init__(self)

        self._code_label = builder.get_object('code_label')
        self._class_label = builder.get_object('class_label')
        self._description_label = builder.get_object('description_label')
        self._additional_textview = builder.get_object('additional_textview')
    
        self._additional_buffer = gtk.TextBuffer()
        self._additional_textview.set_buffer(self._additional_buffer)
Beispiel #29
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from GUI.Manager import Manager
		Manager(self, editor)
		from EncodingListDispatcher import Dispatcher
		Dispatcher(self, editor)
		from EncodingListDatabaseMonitor import Monitor
		Monitor(self, editor)
		from EncodingListDatabaseUpdater import Updater
		Updater(self, editor)
Beispiel #30
0
    def __init__(self, filename):
        GObject.__init__(self)
        self.__accounts = []
        self.next_id = 0
        self.cacheName = filename
        self.__device = NMDevice()

        self.__session = SessionCamel(self)
        self.__session.set_initialized()

        self.__load_cache()
Beispiel #31
0
	def __init__(self, editor):
		GObject.__init__(self)
		from CursorPositioner import Positioner
		Positioner(self, editor)
		from TextInserter import Inserter
		Inserter(self, editor)
		from SpaceProcessor import Processor
		Processor(self, editor)
		from TextExtractor import Extractor
		Extractor(self, editor)
		from OffsetGetter import Getter
		Getter(self, editor)
Beispiel #32
0
 def __init__(self, editor):
     GObject.__init__(self)
     from CursorPositioner import Positioner
     Positioner(self, editor)
     from TextInserter import Inserter
     Inserter(self, editor)
     from SpaceProcessor import Processor
     Processor(self, editor)
     from TextExtractor import Extractor
     Extractor(self, editor)
     from OffsetGetter import Getter
     Getter(self, editor)
Beispiel #33
0
 def __init__ (self):
     GObject.__init__(self)
     
     self.engines = []
     
     self.jsonpath = addUserConfigPrefix("engines.json")
     try:
         self._engines = json.load(open(self.jsonpath))
     except ValueError, e:
         log.warn("engineNest: Couldn\'t read engines.json, renamed it to .bak\n%s\n" % (self.jsonpath,e))
         os.rename(self.jsonpath, self.jsonpath+".bak")
         self._engines = deepcopy(backup)
Beispiel #34
0
    def __init__(self, app):
        GObject.__init__(self)

        self.app = app
        
        self._config = ConfigParser()
        self._filename = os.path.join(save_config_path("garmon"), "config")
        self._config.read(self._filename)
        
        self._dialog = _PrefsDialog()
        
        self._watches = []
Beispiel #35
0
    def __init__(self, glade):
        GObject.__init__(self)
        PropertyObject.__init__(self)

        self._code_label = glade.get_widget('code_label')
        self._class_label = glade.get_widget('class_label')
        self._description_label = glade.get_widget('description_label')
        self._additional_textview = glade.get_widget('additional_textview')

        self._additional_buffer = gtk.TextBuffer()
        self._additional_textview.set_buffer(self._additional_buffer)
        self._dtc_entry = glade.get_widget('dtc_entry')
Beispiel #36
0
	def __init__(self, editor):
		GObject.__init__(self)
		from Selector import Selector
		Selector(self, editor)
		from TextInserter import Inserter
		Inserter(self, editor)
		from CaseProcessor import Processor
		Processor(self, editor)
		from TextExtractor import Extractor
		Extractor(self, editor)
		from Marker import Marker
		Marker(self, editor)
Beispiel #37
0
    def __init__(self, host, ports, username, password):
        GObject.__init__(self)

        self.host = host
        self.ports = ports
        self.username = username
        self.password = password

        self.connected = False
        self.connecting = False

        self.predictions = set()
        self.predictionsDict = {}
Beispiel #38
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from WidgetTransparencyCheckButton import Button
		Button(self, editor)
		from ForkScribesCheckButton import Button
		Button(self, editor)
		from BracketSelectionColorButton import ColorButton
		ColorButton(editor, self)
		from Window import Window
		Window(editor, self)
		from TemplateIndentation.Manager import Manager
		Manager(self, editor)
 def __init__ (self, host, ports, username, password):
     GObject.__init__(self)
     
     self.host = host
     self.ports = ports
     self.username = username
     self.password = password
     
     self.connected = False
     self.connecting = False
     
     self.predictions = set()
     self.predictionsDict = {}
Beispiel #40
0
 def __init__ (self, secs, gain):
     GObject.__init__(self)
     
     self.intervals = [[secs],[secs]]
     self.gain = gain
     
     self.paused = False
     # The left number of secconds at the time pause was turned on
     self.pauseInterval = 0
     self.counter = None
     
     self.started = False
     
     self.movingColor = WHITE
Beispiel #41
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from BusyManager import Manager
		Manager(self, editor)
		from MessageLabel import Label
		Label(self, editor)
		from TitleLabel import Label
		Label(self, editor)
		from Image import Image
		Image(self, editor)
		from WindowTitleUpdater import Updater
		Updater(self, editor)
		from Window import Window
		Window(self, editor)
Beispiel #42
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from BusyManager import Manager
     Manager(self, editor)
     from MessageLabel import Label
     Label(self, editor)
     from TitleLabel import Label
     Label(self, editor)
     from Image import Image
     Image(self, editor)
     from WindowTitleUpdater import Updater
     Updater(self, editor)
     from Window import Window
     Window(self, editor)
Beispiel #43
0
 def __init__(self, editor):
     GObject.__init__(self)
     self.__init_attributes(editor)
     from GUI.Manager import Manager
     Manager(self, editor)
     from TextInserter import Inserter
     Inserter(self, editor)
     from TextColorer import Colorer
     Colorer(self, editor)
     from BufferMonitor import Monitor
     Monitor(self, editor)
     from DictionaryManager import Manager
     Manager(self, editor)
     from DatabaseMonitor import Monitor
     Monitor(self, editor)
Beispiel #44
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from GUI.Manager import Manager
		Manager(self, editor)
		from TextInserter import Inserter
		Inserter(self, editor)
		from TextColorer import Colorer
		Colorer(self, editor)
		from BufferMonitor import Monitor
		Monitor(self, editor)
		from DictionaryManager import Manager
		Manager(self, editor)
		from DatabaseMonitor import Monitor
		Monitor(self, editor)
Beispiel #45
0
	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from Import.Manager import Manager
		Manager(self, editor)
		from Export.Manager import Manager
		Manager(self, editor)
		from EditorGUI.Manager import Manager
		Manager(self, editor)
		from MainGUI.Manager import Manager
		Manager(self, editor)
		from DatabaseUpdater import Updater
		Updater(self, editor)
		# This Monitor object should be initialized last.
		from DatabaseMonitor import Monitor
		Monitor(self, editor)
Beispiel #46
0
    def __init__(self, app):

        GObject.__init__(self)

        self._app = app
        self._glade = app.glade
        self._connection = app.connection

        self._window = self._glade.get_widget('main-window')

        self._images = self._glade.get_widget_prefix('imageD')
        self._labels = self._glade.get_widget_prefix('labelD')
        self._compressors = self._glade.get_widget_prefix('statusKOM')
        for image in self._compressors:
            image.set_from_stock('com-uit', gtk.ICON_SIZE_DIALOG)

        self._connection.connect('data-arrived', self._data_arrived_cb)
 def __init__ (self):
     GObject.__init__(self)
     
     self.backup = ET.ElementTree(fromstring(backup))
     self.xmlpath = addUserConfigPrefix("engines.xml")
     try:
         self.dom = ET.ElementTree(file=self.xmlpath)
         c = compareVersions(self.dom.getroot().get('version', default='0'), ENGINES_XML_API_VERSION)
         if c == -1:
             log.warn("engineNest: engines.xml is outdated. It will be replaced\n")
             self.dom = deepcopy(self.backup)
         elif c == 1:
             raise NotImplementedError, "engines.xml is of a newer date. In order" + \
                             "to run this version of PyChess it must first be removed"
     except ParseError, e:
         log.warn("engineNest: %s\n" % e)
         self.dom = deepcopy(self.backup)
Beispiel #48
0
    def __init__ (self, host):
        GObject.__init__(self)
        self.host = host
        self.subproc = None
        
        self.expression = re.compile("time=([\d\.]+) (m?s)")

        # We need untranslated error messages in regexp search
        # below, so have to use deferred translation here
        def _(msg): return msg
        error = _("Destination Host Unreachable")
        self.errorExprs = (
            re.compile("(%s)" % error),
        )
        del _

        self.restartsOnDead = 3
        self.deadCount = 0
Beispiel #49
0
    def __init__(self, host):
        GObject.__init__(self)
        self.host = host
        self.subproc = None

        self.expression = re.compile("time=([\d\.]+) (m?s)")

        # We need untranslated error messages in regexp search
        # below, so have to use deferred translation here
        def _(msg):
            return msg

        error = _("Destination Host Unreachable")
        self.errorExprs = (re.compile("(%s)" % error), )
        del _

        self.restartsOnDead = 3
        self.deadCount = 0
Beispiel #50
0
    def __init__(self, connection):
        GObject.__init__(self)

        self.connection = connection

        self.connection.expect_line(
            self.onOfferAdd, "<p(t|f)> (\d+) w=%s t=(\w+) p=(.+)" % names)
        self.connection.expect_line(self.onOfferRemove, "<pr> (\d+)")

        for ficsstring, offer, error in (
            ("You cannot switch sides once a game is underway.",
             Offer(SWITCH_OFFER), ACTION_ERROR_SWITCH_UNDERWAY),
            ("Opponent is not out of time.", Offer(FLAG_CALL),
             ACTION_ERROR_NOT_OUT_OF_TIME), ("The clock is not ticking yet.",
                                             Offer(PAUSE_OFFER),
                                             ACTION_ERROR_CLOCK_NOT_STARTED),
            ("The clock is not ticking.", Offer(FLAG_CALL),
             ACTION_ERROR_CLOCK_NOT_STARTED), ("The clock is not paused.",
                                               Offer(RESUME_OFFER),
                                               ACTION_ERROR_CLOCK_NOT_PAUSED)):
            self.connection.expect_line(
                lambda match: self.emit("onActionError", offer, error),
                ficsstring)

        self.connection.expect_line(
            self.notEnoughMovesToUndo,
            "There are (?:(no)|only (\d+) half) moves in your game\.")

        self.connection.expect_line(
            self.noOffersToAccept, "There are no ([^ ]+) offers to (accept).")

        self.connection.expect_line(
            self.onOfferDeclined,
            "\w+ declines the (draw|takeback|pause|unpause|abort|adjourn) request\."
        )

        self.lastPly = 0
        self.offers = {}

        self.connection.lvm.setVariable(
            "formula", "!suicide & !crazyhouse & !bughouse & !atomic")
        self.connection.lvm.setVariable("pendinfo", True)
Beispiel #51
0
	def __init__(self, editor):
		GObject.__init__(self)
		from HideTimer import Timer
		Timer(self, editor)
		from APIVisibilityUpdater import Updater
		Updater(self, editor)
		from VisibilityUpdater import Updater
		Updater(self, editor)
		from Resizer import Resizer
		Resizer(self, editor)
		from Animator import Animator
		Animator(self, editor)
		from Displayer import Displayer
		Displayer(self, editor)
		from MouseSensor import Sensor
		Sensor(self, editor)
		from DeltaCalculator import Calculator
		Calculator(self, editor)
		from SizeUpdater import Updater
		Updater(self, editor)
Beispiel #52
0
    def __init__(self):
        GObject.__init__(self)

        self.backup = ET.ElementTree(fromstring(backup))
        self.xmlpath = addUserConfigPrefix("engines.xml")
        try:
            self.dom = ET.ElementTree(file=self.xmlpath)
            c = compareVersions(self.dom.getroot().get('version', default='0'),
                                ENGINES_XML_API_VERSION)
            if c == -1:
                log.warn(
                    "engineNest: engines.xml is outdated. It will be replaced\n"
                )
                self.dom = deepcopy(self.backup)
            elif c == 1:
                raise NotImplementedError, "engines.xml is of a newer date. In order" + \
                                "to run this version of PyChess it must first be removed"
        except ParseError, e:
            log.warn("engineNest: %s\n" % e)
            self.dom = deepcopy(self.backup)
Beispiel #53
0
	def __init__(self, editor):
		GObject.__init__(self)
		from Selector import Selector
		Selector(self, editor)
		from TextInserter import Inserter
		Inserter(self, editor)
		from SelectionProcessor import Processor
		Processor(self, editor)
		from IndentationProcessor import Processor
		Processor(self, editor)
		from IndentationCharacter import Character
		Character(self, editor)
		from TextExtractor import Extractor
		Extractor(self, editor)
		from Marker import Marker
		Marker(self, editor)
		from OffsetExtractor import Extractor
		Extractor(self, editor)
		from Refresher import Refresher
		Refresher(self, editor)
Beispiel #54
0
    def __init__(self, configurations, data_dir):
        GObject.__init__(self)
        self.data_dir = data_dir
        
        # Mapping async types to their handlers
        self.registered_async_handlers = dict()

        self.conf = configurations
        self.server_communicator = NIServerCommunicator(self, configurations)
        self.shell = NIShell(self)
        self.ui_manager = NIUIManager(self, configurations)
        self.shell.ui_manager = self.ui_manager

        self.modules = dict()
        self._load_modules()
        self._init_handlers()
        self.shell.initialize_modules()

        self.logged_in = False
        self.network_message_recv = False