Hanno Böck commited on 2020-06-19 20:11:16
Zeige 1 geänderte Dateien mit 1 Einfügungen und 28 Löschungen.
| ... | ... |
@@ -1,33 +1,9 @@ |
| 1 | 1 |
#!/usr/bin/python3 |
| 2 | 2 |
|
| 3 | 3 |
import os |
| 4 |
-import glob |
|
| 5 |
-import pathlib |
|
| 6 |
-import shutil |
|
| 7 | 4 |
import setuptools |
| 8 | 5 |
import setuptools.command.install |
| 9 | 6 |
|
| 10 |
- |
|
| 11 |
-class install_freewvsdb(setuptools.command.install.install): |
|
| 12 |
- def run(self): |
|
| 13 |
- dbpaths = ['/var/lib/freewvs/', |
|
| 14 |
- str(pathlib.Path.home()) + "/.cache/freewvs/"] |
|
| 15 |
- |
|
| 16 |
- target = False |
|
| 17 |
- for dbpath in dbpaths: |
|
| 18 |
- if not os.path.isdir(dbpath): |
|
| 19 |
- try: |
|
| 20 |
- os.makedirs(dbpath) |
|
| 21 |
- except PermissionError: |
|
| 22 |
- continue |
|
| 23 |
- if os.access(dbpath, os.W_OK): |
|
| 24 |
- target = dbpath |
|
| 25 |
- break |
|
| 26 |
- for j in glob.glob("freewvsdb/*.json"):
|
|
| 27 |
- shutil.copy(j, target) |
|
| 28 |
- setuptools.command.install.install.run(self) |
|
| 29 |
- |
|
| 30 |
- |
|
| 31 | 7 |
f = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')) |
| 32 | 8 |
readme = f.read() |
| 33 | 9 |
f.close() |
| ... | ... |
@@ -55,8 +31,5 @@ setuptools.setup( |
| 55 | 31 |
'Programming Language :: Python :: 3.6', |
| 56 | 32 |
'Programming Language :: Python :: 3.7', |
| 57 | 33 |
'Programming Language :: Python :: 3.8', |
| 58 |
- ], |
|
| 59 |
- cmdclass={
|
|
| 60 |
- 'install': install_freewvsdb |
|
| 61 |
- } |
|
| 34 |
+ ] |
|
| 62 | 35 |
) |
| 63 | 36 |