forked from Lynx3d/pylotro
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
executable file
·58 lines (49 loc) · 1.69 KB
/
setup.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
55
56
57
#!/usr/bin/env python
# coding=utf-8
import PyLotROLauncher.Information
import sys
import os
import shutil
from distutils.core import setup
installMode = False
uninstallMode = False
for arg in sys.argv:
if arg == 'install':
installMode = True
elif arg == 'uninstall':
uninstallMode = True
if uninstallMode:
logfile = open("pylotro-install.log", "r")
maindir = ""
# read through the install log deleting every file installed
for filename in logfile.readlines():
tempfile = filename.replace("\n", "")
print(("removing %s" % (tempfile)))
os.remove(tempfile)
# If the directory name ends with PyLotROLauncher then this is the base directory for the installation
if os.path.dirname(tempfile).endswith("PyLotROLauncher"):
maindir = os.path.dirname(tempfile)
logfile.close()
# Remove the base installation directory
print(("removing %s" % (maindir)))
shutil.rmtree(maindir)
os.remove("pylotro-install.log")
else:
opts = {}
# If called with install capture the installation to to pylotro-install.log
if installMode:
opts["install"] = { "record" : "pylotro-install.log" }
setup(name = "PyLotROLauncher",
version = PyLotROLauncher.Information.Version,
description = PyLotROLauncher.Information.Description,
author = PyLotROLauncher.Information.Author,
author_email = PyLotROLauncher.Information.Email,
url = PyLotROLauncher.Information.WebSite,
packages = ['PyLotROLauncher'],
scripts = ["pylotro"],
data_files = [('share/pixmaps', ['PyLotRO_Menu.png']),
('share/applications',['PyLotRO.desktop']),],
package_data = {'PyLotROLauncher' : ["*.png", "ui/*", "images/*", "certificates/*.pem"] },
long_description = PyLotROLauncher.Information.LongDescription,
options = opts
)