-
Notifications
You must be signed in to change notification settings - Fork 45
/
abspath.py
34 lines (21 loc) · 717 Bytes
/
abspath.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
import inspect
import os
oldpath = os.path.join
def newpath(path, *paths):
a = oldpath(path, *paths)
if type(a).__name__ != "str":
return a
return a.replace("\\", "/")
os.path.join = newpath
class Dummy: pass
abspath = os.path.dirname(os.path.relpath(inspect.getsourcefile(Dummy)))
abspath = abspath.replace("\\", "/")
configpath = os.path.join(abspath, "config.json")
settingspath = os.path.join(abspath, "settings.json")
pppath = os.path.join(abspath, "ppsettings.json")
optionconfigpath = os.path.join(abspath, 'options_config.json')
cachepath = os.path.join(abspath, 'hashCache.db')
tooltippath = os.path.join(abspath, "tooltips.json")
class Log:
apppath = "app.log"
runosupath = "runosu.log"