-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathupdate.py
37 lines (29 loc) · 928 Bytes
/
update.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
# copy Macast-plugins to your local config dirs
import os
import shutil
import appdirs
CONFIG_DIR = appdirs.user_config_dir('Macast', 'xfangfang')
def main():
# get plugins path
current_path = os.path.dirname(os.path.abspath(__file__))
print(current_path)
plugins_path = []
for root, dirs, files in os.walk(current_path):
for file in files:
if ".py" in file and file not in ['update.py', 'info.py', 'example.py']:
plugins_path.append(os.path.join(root, file))
print('\n'.join(plugins_path))
# create macast config dir
target = os.path.join(CONFIG_DIR, 'renderer')
try:
os.makedirs(target)
except FileExistsError as e:
pass
# copy plugins to macast config dir
for i in plugins_path:
try:
shutil.copy(i, target)
except Exception as e:
print(e)
if __name__ == '__main__':
main()