forked from ChristianMeisenbichler/SAXS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
101 lines (91 loc) · 3.67 KB
/
Copy pathsetup.py
File metadata and controls
101 lines (91 loc) · 3.67 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
from setuptools import setup
versionstring="2.0b1"
setup(
name="SAXS",
version=versionstring,
packages=["SAXS"],
package_data={"SAXS": ["icons/*",
"schema.json",
"schema_1.json",
"LeashRequestSchema.json",
"LeashResultSchema.json",
"NetworkSchema.json",
"LeashMW.ui",
"importdialog.ui",
"DataConsolidationConf.json",
"consolconftemplate.json"
]},
author="Christian Meisenbichler",
author_email="chmberg@gmail.com",
description="Tools for analysing SAXS Data",
scripts =["postinstall.py"],
install_requires=["numpy",
"scipy",
"matplotlib",
"jsonschema",
"bitarray",
"watchdog",
"sphinxcontrib-programoutput",
"sphinxcontrib-programscreenshot",
"pyzmq","prettyplotlib",
"pandas"],
license="Proprietary",
entry_points = {
'console_scripts': [
'saxsconverter = SAXS:convert',
'saxsdog = SAXS:saxsdog',
'plotchi=SAXS:plotchi',
'saxsdogserver = SAXS:launcher',
'saxsleash =SAXS:saxsleash',
'saxsfeeder=SAXS:saxsfeeder',
"saxsnetconf=SAXS:gennetconf",
"saxsdmerge=SAXS:merge"
],
'gui_scripts':[
'leash=SAXS:LeashGUI'
]
}
)
try:
import py2exe
except:
print "No py2exe here"
from subprocess import call
import sys,os
if sys.argv[1] == 'install':
if os.name == "nt":
import _winreg as wr
pyw_executable = os.path.join(sys.prefix,'pythonw.exe')
script_file = '"'+os.path.join(sys.prefix,"Scripts","leash-script.pyw")+'"'
iconpath= os.path.expanduser(
os.path.join(
sys.prefix,
"Lib",
"site-packages",
"SAXS",
"icons",
"program.ico"))
wr.SetValue(wr.HKEY_CURRENT_USER,"Software\Classes\TUG.Leash\shell\open\command",wr.REG_SZ,pyw_executable+" \""+ script_file+ "\" \"%1\"")
wr.SetValue( wr.HKEY_CURRENT_USER,"Software\Classes\TUG.Leash\DefaultIcon",wr.REG_SZ,iconpath)
wr.SetValue( wr.HKEY_CURRENT_USER,"Software\Classes\.saxsconf",wr.REG_SZ, "TUG.Leash");
print "added registry values for extensions"
import winshell
import win32com
w_dir = os.path.expanduser('~')
desktop_path = winshell.desktop()
startmenu_path =win32com.shell.shell.SHGetSpecialFolderPath(0, win32com.shell.shellcon.CSIDL_STARTMENU)
with winshell.shortcut( os.path.join(startmenu_path,'SAXSLeash.lnk')) as link:
link.path= pyw_executable
link.description = "Control panel for SAXSdog Server"
link.arguments = script_file
link.icon_location=(iconpath,0)
with winshell.shortcut( os.path.join(desktop_path,'SAXSLeash.lnk')) as link:
link.path= pyw_executable
link.description = "Control panel for SAXSdog Server"
link.arguments = script_file
link.icon_location=(iconpath,0)
print startmenu_path
call(["ie4uinit.exe" ,"-ClearIconCache"])
elif os.name == "posix":
print os.name
call(["bash","addmime.sh"])