Skip to content

Commit

Permalink
moving common pct(0) to upload
Browse files Browse the repository at this point in the history
  • Loading branch information
emorrp1 committed Sep 10, 2009
1 parent ed0c584 commit 2cc8261
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions usr/lib/linuxmint/mintUpload/mintUploadCore.py
Expand Up @@ -159,6 +159,7 @@ def upload(self, file):
self.file = file
self.name = os.path.basename(self.file)
self.filesize = os.path.getsize(self.file)
self.pct(0)
self.uploader()
self.success()

Expand All @@ -182,7 +183,6 @@ def _ftp(self):

f = open(self.file, "rb")
self.progress(_("Uploading the file..."))
self.pct(0)
self.so_far = 0
ftp.storbinary('STOR ' + self.name, f, 1024, callback=self.asciicallback)

Expand Down Expand Up @@ -224,7 +224,6 @@ def _sftp(self):

sftp = paramiko.SFTPClient.from_transport(transport)
self.progress(_("Uploading the file..."))
self.pct(0)
sftp.put(self.file, path + self.name, self.pct)

finally:
Expand Down Expand Up @@ -253,7 +252,6 @@ def _scp(self):
self.progress(self.service['type'] + " " + _("connection successfully established"))

scp.timeout = None
self.pct(0)
received = scp.expect(['.*100\%.*','.*password:.*',pexpect.EOF])
if received == 1:
scp.sendline(' ')
Expand Down

0 comments on commit 2cc8261

Please sign in to comment.