v.licheni.net
/
stack
/
code
/
dboxswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added profhandler.getProfileBaseName
[stack/code/dboxswitch.git]
/
profhandler.py
diff --git
a/profhandler.py
b/profhandler.py
old mode 100755
(executable)
new mode 100644
(file)
index
d0fbb17
..
5afefaa
--- a/
profhandler.py
+++ b/
profhandler.py
@@
-133,8
+133,6
@@
class ProfHandler():
if ppath in self.getProfilesList():
self.stopDropbox()
try:
if ppath in self.getProfilesList():
self.stopDropbox()
try:
- print self.getDropboxDirectory()
- print ppath
if pl in ('Linux','Darwin'):
if os.path.exists(self.getDropboxDirectory()):
os.unlink(self.getDropboxDirectory())
if pl in ('Linux','Darwin'):
if os.path.exists(self.getDropboxDirectory()):
os.unlink(self.getDropboxDirectory())
@@
-142,11
+140,16
@@
class ProfHandler():
else:
raise NotImplementedError, "Not implemented yet."
except IOError as e:
else:
raise NotImplementedError, "Not implemented yet."
except IOError as e:
- raise AppError('Error on activating Profile: '+
os.path.basen
ame(ppath))
+ raise AppError('Error on activating Profile: '+
self.getBaseProfileN
ame(ppath))
self.startDropbox()
else:
raise AppError("Trying to acrivate non existant profile")
self.startDropbox()
else:
raise AppError("Trying to acrivate non existant profile")
+ def getBaseProfileName(self, ppath):
+ """ Returns the base name given a profile returned by getProfilesList """
+
+ return os.path.basename(ppath)
+
def getDropboxDirectory(self):
pl = platform.system()
if pl in ('Linux', 'Darwin'):
def getDropboxDirectory(self):
pl = platform.system()
if pl in ('Linux', 'Darwin'):
@@
-160,6
+163,8
@@
class ProfHandler():
def stopDropbox(self):
""" Stop dropbox Daemon """
pl = platform.system()
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:
if pl in ('Linux','Darwin'):
pidfile = os.path.expanduser("~/.dropbox/dropbox.pid")
try: