1. Josh VanderLinden
  2. clip2zeus


Josh VanderLinden  committed fff5779

Fixed the XML-RPC client to properly return values. Improved the GUI a little.

  • Participants
  • Parent commits 4b7d87a
  • Branches default

Comments (0)

Files changed (5)

File clip2zeus/common.py

View file
         """Returns the current polling interval in seconds"""
         logger.debug('Interval requested by client: %s' % (self.interval,))
-        return config.getint('main', 'interval', default)
+        return self.interval
     def set_interval(self, interval):
         """Sets the clipboard polling frequency.
             elif cmd in Clip2ZeusApp.EXPOSED:
                 func = getattr(self.proxy, cmd)
-                func(*args)
+                return func(*args)
                 logger.error('Invalid command: %s' % (cmd, ))
                 sys.exit('Invalid command.  Options include: %s' % ', '.join(Clip2ZeusApp.EXPOSED))

File clip2zeus/config.py

View file
 LOG_FILE = os.path.join(CONFIG_DIR, 'clip2zeus.log')
 LOG_LEVEL = logging.DEBUG
-LOG_FORMAT = '%(levelname)-8s %(asctime)s %(module)s:%(lineno)d %(message)s'
+LOG_FORMAT = '%(levelname)-8s %(asctime)s [%(process)d]%(module)s:%(lineno)d %(message)s'

File clip2zeus/globals.py

View file
         sock.bind(('localhost', port))
     except socket.error, err:
         logger.debug('Caught an exception: %s' % (err,))
-        if err[0] in (48, 10048, 10061): # address already in use
+        if err[0] in (98, 48, 10048, 10061): # address already in use
             return False
             raise err

File clip2zeus/gui.py

View file
         self.opt_manual = tk.Radiobutton(self.parent, text='Manual shortening',
             value=ID_MANUAL, variable=self.opt_value, command=self.mode_selected)
         self.scl_interval = tk.Scale(self.parent, from_=0, to=30,
-            label='Interval', orient=tk.HORIZONTAL, tickinterval=10, command=self.mode_selected)
+            label='Interval', orient=tk.HORIZONTAL, tickinterval=10,
+            command=self.mode_selected)
         self.btn_shorten = tk.Button(self.parent, text="Shorten", command=self.check_clipboard)
         self.btn_quit = tk.Button(self.parent, text="Quit", command=self.quit)
         logger.debug('Arranging widgets')
         self.opt_manual.grid(row=0, column=0, sticky='w')
         self.opt_poll.grid(row=1, column=0, sticky='w')
-        self.btn_shorten.grid(row=0, column=1, sticky='e')
-        self.btn_quit.grid(row=1, column=1, sticky='e')
-        self.scl_interval.grid(row=2, column=0, sticky='w')
+        self.btn_shorten.grid(row=0, column=1, sticky='we')
+        self.btn_quit.grid(row=1, column=1, sticky='we')
+        self.scl_interval.grid(row=2, column=0, columnspan=2, sticky='we')
         cur_interval = self.execute_command('get_interval')
         logger.debug('Received "%s" as the current interval' % (cur_interval,))
-        #self.scl_interval.set(cur_interval)
+        self.scl_interval.set(cur_interval)
+        self.parent.columnconfigure(0, weight=1)
     def notify(self, message):
         """Tells the user something"""

File clip2zeus/linux.py

View file
     def check_clipboard(self):
         """Checks the system clipboard for data"""
-        print 'Checking in linux'
         clipboard = gtk.clipboard_get()
         return clipboard.wait_for_text()
     def update_clipboard(self, text):
         """Updates the system clipboard with the specified text"""
-        print 'Updating in linux'
         clipboard = gtk.clipboard_get()