Josh VanderLinden avatar Josh VanderLinden committed fff5779

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

Comments (0)

Files changed (5)

clip2zeus/common.py

         """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.
                 self.help(*args)
             elif cmd in Clip2ZeusApp.EXPOSED:
                 func = getattr(self.proxy, cmd)
-                func(*args)
+                return func(*args)
             else:
                 logger.error('Invalid command: %s' % (cmd, ))
                 sys.exit('Invalid command.  Options include: %s' % ', '.join(Clip2ZeusApp.EXPOSED))

clip2zeus/config.py

 
 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'
 

clip2zeus/globals.py

         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
         else:
             raise err
         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"""

clip2zeus/linux.py

     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()
         clipboard.set_text(text)
         clipboard.store()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.