+ def stopDropbox(self):
+ """ Stop dropbox Daemon """
+ pl = platform.system()
+ if pl == 'Linux':
+ os.system("dropbox stop")
+ if pl in ('Linux','Darwin'):
+ pidfile = os.path.expanduser("~/.dropbox/dropbox.pid")
+ try:
+ with open(pidfile, "r") as f:
+ pid = int(f.read())
+ os.kill(pid, signal.SIGTERM)
+ except:
+ pass
+
+ def startDropbox(self):
+ """ Sart dropbox Daemon """
+
+ pl = platform.system()
+ if pl == 'Linux':
+ try:
+ os.system("dropbox start -i")
+ except:
+ raise AppError(u"Could not start dropbox.")
+ elif pl == 'Darwin':
+ os.system("/Applications/Dropbox.app/Contents/MacOS/Dropbox &")
+