-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
35 lines (30 loc) · 975 Bytes
/
install.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
#!/usr/bin/env python3
"""
Ampache-FM Safe Install Script
Install if dependencies are satisfied
"""
import os
import shutil
import depends_test
INSTALLPATH = os.path.join(os.getenv('HOME'),
".local/share/rhythmbox/plugins/ampache-fm")
INSTALLFILES = ['AUTHORS',
'LICENSE',
'README.md',
'ampache-fm.plugin',
'config.ui',
'ampache-fm.py',
'ampache.py']
# The depends test will check for required modules
if depends_test.check():
# check plugin directory
if not os.path.exists(INSTALLPATH):
os.makedirs(INSTALLPATH)
# copy the contents of the plugin directory
for i in os.listdir('./'):
if os.path.isfile(i) and i in INSTALLFILES:
print('Copying... ' + i)
shutil.copy(i, INSTALLPATH)
print('\nampache-fm is now installed\n')
else:
print('please check your OS for missing packages')