-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlabrad_postinstall.py
54 lines (45 loc) · 1.69 KB
/
labrad_postinstall.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (C) 2007 Matthew Neeley
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import with_statement
import os
import sys
menuDir = "LabRAD"
menuPath = os.path.join(get_special_folder_path("CSIDL_COMMON_PROGRAMS"),
menuDir)
scriptsPath = os.path.join(sys.prefix, 'Scripts')
twistdPath = os.path.join(scriptsPath, 'twistd.py')
ipyPath = os.path.join(scriptsPath, 'ipython.py')
libPath = os.path.join(sys.prefix, 'Lib', 'site-packages', 'labrad')
configPath = os.path.join(sys.prefix, 'Lib', 'site-packages', 'labrad', 'config')
def mkdir(a, *p):
"""Make a directory and tell the installer."""
path = os.path.join(a, *p)
if not os.path.isdir(path):
os.mkdir(path)
directory_created(path)
def rmdir(a, *p):
path = os.path.join(a, *p)
os.rmdir(path)
def install():
pass
def remove():
pass
if __name__ == '__main__':
if sys.argv[1] == '-install':
install()
elif sys.argv[1] == '-remove':
remove()
else:
raise Exception('Unknown options: %s.' % sys.argv)