-
Notifications
You must be signed in to change notification settings - Fork 3
/
initial.py
40 lines (36 loc) · 869 Bytes
/
initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
import ast
import hashlib
import time
import userdata
import server
idList={}
path = "/home/"+userdata.username+"/GoogleDrive"
path_hidden = "/home/"+userdata.username+"/.GoogleDrive"
def saveID (mainNode,location):
global path,idList
for node in mainNode.link:
idList[path+location+node.name]=node.id
if node.md5Checksum == "Folder":
saveID(node,location+node.name+"/")
return
def fetchID():
global path,path_hidden
mainNode=server.returnRootNode()
saveID(mainNode,"/")
idList[path]=mainNode.id
f=open(path_hidden+"/ids.txt","w")
f.write(str(idList))
f.close()
return
def fetchIDAtSetup():
global path,path_hidden
mainNode=server.DownloadAtSetup()
print "Downloads completed"
#server.prettyPrint(mainNode,0)
saveID(mainNode,"/")
idList[path]=mainNode.id
f=open(path_hidden+"/ids.txt","w")
f.write(str(idList))
f.close()
return