Skip to content

Commit e156a1e

Browse files
authored
Update skyhookUpDown.py
1 parent abc90b0 commit e156a1e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

skyhookUpDown.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from datetime import datetime
1414
import os, skyhookDb, random, string, skyhookConfig
1515

16+
tmpDir = skyhookConfig.tmpDir.rstrip('/')
17+
1618
def getRandomString(length):
1719
return("".join(random.choice(string.ascii_letters + string.digits) for i in range(length)))
1820

@@ -25,14 +27,14 @@ def uploadFile(fileName):
2527
else:
2628
password = getRandomString(32)
2729
aesName = "{}.sky".format(fileName)
28-
tmpPath = "{}/{}".format(skyhookConfig.tmpDir.rstrip('/'), aesName)
30+
tmpPath = "{}/{}".format(tmpDir, aesName)
2931
print("[+] Encrypting {}".format(fileName))
3032
try:
3133
skyhookfilecrypt.encryptFile(fileName, tmpPath, bytes(password, "ascii"))
3234
except:
3335
os.remove(tmpPath)
3436
return(2)
35-
os.chdir(skyhookConfig.tmpDir)
37+
os.chdir(tmpDir)
3638
print("[+] Uploading {}".format(fileName))
3739
try:
3840
result = peer.add(aesName)
@@ -59,7 +61,7 @@ def downloadFile(fileHash):
5961
if fileName == 1 and password == 1:
6062
return(1)
6163
saveFile = "{}/{}".format(currentDir, fileName)
62-
os.chdir(skyhookConfig.tmpDir)
64+
os.chdir(tmpDir)
6365
print("[+] Downloading {}".format(fileName))
6466
try:
6567
peer.get(fileHash)

0 commit comments

Comments
 (0)