-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdevinst.py
30 lines (22 loc) · 916 Bytes
/
devinst.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
# SCR : vfjLib Dinamic Dev Installer
# VER : 0.02
# - Dependencies --------------------------
from __future__ import print_function
from distutils.sysconfig import get_python_lib
import os, sys
# - Init
moduleName = 'vfjLib'
moduleSubPath = 'Lib'
# - Functions --------------------------
def installModule(srcDir, modulePathName):
sitePackDir = get_python_lib()
fileName = os.path.join(sitePackDir, '%s.pth' %modulePathName)
print('\nINFO:\t Installing %s library...\nPATH:\t%r\nFILE:\t%r\n\n' %(moduleName, srcDir, fileName))
file = open(fileName, 'w')
file.write(srcDir)
file.close()
return fileName
# - Run --------------------------
intallDir = os.path.join(os.path.dirname(os.path.normpath(os.path.abspath(sys.argv[0]))), moduleSubPath)
fileName = installModule(intallDir, moduleName)
print('DONE:\t%s installed!\nNOTE:\tRun script again if you change the location of the library' %moduleName)