Permalink
Browse files

removed gist-related code

  • Loading branch information...
1 parent a0365b8 commit 19a579f8d610c47ff0b2d9ff5882a9f599eafa7b @lavelle committed Apr 30, 2012
Showing with 6 additions and 12 deletions.
  1. +6 −6 src/lib/dbox.py
  2. +0 −6 src/lib/main.py
View
@@ -85,7 +85,7 @@ def upload(self, path, filepath=None):
try:
self.m.message('Uploading...')
- # Open the file located at path and upload it to the dropbox servers
+ # Open the file located at path and upload it to the Dropbox servers
response = self.client.put_file(filepath, open(path, 'rb'))
self.m.message('Upload finished')
except Exception as error:
@@ -142,11 +142,10 @@ def create_folder(self, folder_name, num=1):
new_folder_name = folder_name
+ if num > 1:
+ new_folder_name += '_(%s)' % num
# Try to create a folder with the given name
try:
- if num > 1:
- new_folder_name += '_(' + str(num) + ')'
-
self.client.file_create_folder('/' + new_folder_name)
if num > 1:
@@ -157,6 +156,7 @@ def create_folder(self, folder_name, num=1):
except ErrorResponse as e:
if e.status == 403:
# It failed because a folder with that name already exists
- # Increment a number and append it to the folder name
+ # Increment a number to be appended to the folder name
# then call the function recursively until it works
- self.create_folder(folder_name, num=num + 1)
+ num += 1
+ self.create_folder(folder_name, num=num)
View
@@ -133,9 +133,6 @@ def upload(args):
def snippet(args):
"""Upload the contents of the user's clipboard as a text file"""
- # gist functionality on hold - dropbox works fine for now
- # from gist import Gist
-
clipboard = Clipboard().get()
if clipboard is None:
return
@@ -150,9 +147,6 @@ def snippet(args):
handle_files([path], [filename], args.share)
- #elif args.text == 'gist':
- # Gist().upload(filename, clipboard)
-
def history(args):
"""Display the history of previously uploaded file"""

0 comments on commit 19a579f

Please sign in to comment.