-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataPath.py
115 lines (85 loc) · 2.87 KB
/
dataPath.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import os
import dropbox
from threading import Thread
import DEBUG as dbg
TOKEN="<Enter your dropbox token>" #Not Needed
DBX = dropbox.Dropbox(TOKEN)
# PKG = 'AonW_zfyfk01jren8p'
PKG = '44520AdityaT.AonWAssistantonWindows_6b21v8kbxxjsp'
WindowsStore = not dbg.DEBUG
DEBUG = dbg.DEBUG
font = "@Malgun Gothic Semilight"
'''class PathVar():
path = ''
'''
#def getPkgName(path=PathVar.path, i=0):
def getPkgName(path, i):
if i<=10:
metadata, res = DBX.files_download(path='/AonW/PackageName/pkg.txt')
content=res.content
pkg = str(content)
pkg = pkg.split("'")
pkg = pkg[1]
print(pkg)
dataPath.htmlPath = path+'Local\\Packages\\'+pkg+'\\LocalCache\\Roaming\\AonW\\data'
if os.path.exists(dataPath.htmlPath):
dataPath.htmlPath = ''
#getPkgName(path=path, i=i+1)
getPkgName(path, i+1)
else:
dataPath.htmlPath = ''
class dataPath():
if not DEBUG:
if not WindowsStore:
dataPath = os.path.join(os.getenv('APPDATA'), 'AonW\\data')
htmlPath = os.path.join(os.getenv('APPDATA'), 'AonW\\data')
else:
dataPath = os.path.join(os.getenv('APPDATA'), 'AonW\\data')
htmlPath = ''
pkg = PKG
try:
s = os.getenv('APPDATA')
print(s)
print(s.split('\\'))
s=s.split('\\')
path=''
for i in range(0, len(s)-1):
path+=s[i]+'\\'
htmlPath = path+'Local\\Packages\\'+pkg+'\\LocalCache\\Roaming\\AonW\\data'
dataPath = htmlPath
if not os.path.exists(htmlPath):
htmlPath = ''
s = os.getenv('APPDATA')
print(s)
print(s.split('\\'))
s=s.split('\\')
path=''
for i in range(0, len(s)-1):
path+=s[i]+'\\'
t = Thread(target = lambda:getPkgName(path, 0))
t.daemon = True
t.start()
print(path)
'''
PathVar.path = path
#t = Thread(target = lambda:getPkgName())
#t.daemon = True
#t.start()
getPkgName()
print(path)
htmlpath = path
'''
print(htmlPath)
except:
pass
# C:\Users\Aditya Thakur\AppData\Local\Packages\AonW_zfyfk01jren8p\LocalCache\Roaming\AonW\data
else:
dataPath = os.getcwd()
htmlPath = os.getcwd()
print(WindowsStore)
print(DEBUG)
print("................")
print(dataPath.dataPath)
print("................")
print(dataPath.htmlPath)
print("................")