4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Revised BSD License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 Revised BSD License for more details.
12 Copyright 2016 Cool Dude 2k - http://idb.berlios.de/
13 Copyright 2016 Game Maker 2k - http://intdb.sourceforge.net/
14 Copyright 2016 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
16 $FileInfo: setup.py - Last Update: 8/19/2016 Ver. 0.4.7 RC 2 - Author: cooldude2k $
19 import re
, os
, sys
, time
, datetime
, platform
, pkg_resources
;
20 from setuptools
import setup
, find_packages
;
22 verinfofilename
= os
.path
.realpath("."+os
.path
.sep
+os
.path
.sep
+"pymotherless.py");
23 verinfofile
= open(verinfofilename
, "r");
24 verinfodata
= verinfofile
.read();
26 setuppy_verinfo_esc
= re
.escape("__version_info__ = (")+"(.*)"+re
.escape(");");
27 setuppy_verinfo
= re
.findall(setuppy_verinfo_esc
, verinfodata
)[0];
28 setuppy_verinfo_exp
= [vergetspt
.strip().replace("\"", "") for vergetspt
in setuppy_verinfo
.split(',')];
29 setuppy_dateinfo_esc
= re
.escape("__version_date_info__ = (")+"(.*)"+re
.escape(");");
30 setuppy_dateinfo
= re
.findall(setuppy_dateinfo_esc
, verinfodata
)[0];
31 setuppy_dateinfo_exp
= [vergetspt
.strip().replace("\"", "") for vergetspt
in setuppy_dateinfo
.split(',')];
33 pymodule
['version'] = str(setuppy_verinfo_exp
[0])+"."+str(setuppy_verinfo_exp
[1])+"."+str(setuppy_verinfo_exp
[2]);
34 pymodule
['versionrc'] = int(setuppy_verinfo_exp
[4]);
35 pymodule
['versionlist'] = (int(setuppy_verinfo_exp
[0]), int(setuppy_verinfo_exp
[1]), int(setuppy_verinfo_exp
[2]), str(setuppy_verinfo_exp
[3]), int(setuppy_verinfo_exp
[4]));
36 pymodule
['verdate'] = str(setuppy_dateinfo_exp
[0])+"."+str(setuppy_dateinfo_exp
[1])+"."+str(setuppy_dateinfo_exp
[2]);
37 pymodule
['verdaterc'] = int(setuppy_dateinfo_exp
[4]);
38 pymodule
['verdatelist'] = (int(setuppy_dateinfo_exp
[0]), int(setuppy_dateinfo_exp
[1]), int(setuppy_dateinfo_exp
[2]), str(setuppy_dateinfo_exp
[3]), int(setuppy_dateinfo_exp
[4]));
39 pymodule
['name'] = 'PyMotherless';
40 pymodule
['author'] = 'Kazuki Przyborowski';
41 pymodule
['authoremail'] = 'kazuki.przyborowski@gmail.com';
42 pymodule
['maintainer'] = 'Kazuki Przyborowski';
43 pymodule
['maintaineremail'] = 'kazuki.przyborowski@gmail.com';
44 pymodule
['description'] = 'Get urls of images/videos from motherless.';
45 pymodule
['license'] = 'Revised BSD License';
46 pymodule
['keywords'] = 'motherless pymotherless python python-motherless';
47 pymodule
['url'] = 'https://github.com/GameMaker2k/PyMotherless';
48 pymodule
['downloadurl'] = 'https://github.com/GameMaker2k/PyMotherless/archive/master.tar.gz';
49 pymodule
['longdescription'] = 'Get urls of images/videos from motherless.';
50 pymodule
['platforms'] = 'OS Independent';
51 pymodule
['zipsafe'] = True;
52 pymodule
['pymodules'] = ['pymotherless'];
53 pymodule
['classifiers'] = [
54 'Development Status :: 5 - Production/Stable',
55 'Intended Audience :: Developers',
56 'Intended Audience :: Other Audience',
57 'License :: OSI Approved',
58 'License :: OSI Approved :: BSD License',
59 'Natural Language :: English',
60 'Operating System :: MacOS',
61 'Operating System :: MacOS :: MacOS X',
62 'Operating System :: Microsoft',
63 'Operating System :: Microsoft :: Windows',
64 'Operating System :: OS/2',
65 'Operating System :: OS Independent',
66 'Operating System :: POSIX',
67 'Operating System :: Unix',
68 'Programming Language :: Python',
70 'Topic :: Software Development',
71 'Topic :: Software Development :: Libraries',
72 'Topic :: Software Development :: Libraries :: Python Modules'
74 if(len(sys
.argv
)>1 and (sys
.argv
[1]=="versioninfo" or sys
.argv
[1]=="getversioninfo")):
76 pymodule_data
= json
.dumps(pymodule
);
79 if(len(sys
.argv
)>1 and (sys
.argv
[1]=="sourceinfo" or sys
.argv
[1]=="getsourceinfo")):
80 srcinfofilename
= os
.path
.realpath("."+os
.path
.sep
+pkg_resources
.to_filename(pymodule
['name'])+".egg-info"+os
.path
.sep
+"SOURCES.txt");
81 srcinfofile
= open(srcinfofilename
, "r");
82 srcinfodata
= srcinfofile
.read();
84 srcinfolist
= srcinfodata
.split('\n');
86 srcpdir
= os
.path
.basename(os
.path
.dirname(os
.path
.realpath(__file__
)));
87 for ifile
in srcinfolist
:
88 srcfilelist
= "."+os
.path
.sep
+srcpdir
+os
.path
.sep
+ifile
+" "+srcfilelist
;
91 if(len(sys
.argv
)>1 and sys
.argv
[1]=="cleansourceinfo"):
92 os
.system("rm -rfv \""+os
.path
.realpath("."+os
.path
.sep
+"dist\""));
93 os
.system("rm -rfv \""+os
.path
.realpath("."+os
.path
.sep
+pkg_resources
.to_filename(pymodule
['name'])+".egg-info\""));
97 name
= pymodule
['name'],
98 version
= pymodule
['version'],
99 author
= pymodule
['author'],
100 author_email
= pymodule
['authoremail'],
101 maintainer
= pymodule
['maintainer'],
102 maintainer_email
= pymodule
['maintaineremail'],
103 description
= pymodule
['description'],
104 license
= pymodule
['license'],
105 keywords
= pymodule
['keywords'],
106 url
= pymodule
['url'],
107 download_url
= pymodule
['downloadurl'],
108 long_description
= pymodule
['longdescription'],
109 platforms
= pymodule
['platforms'],
110 zip_safe
= pymodule
['zipsafe'],
111 py_modules
= pymodule
['pymodules'],
112 classifiers
= pymodule
['classifiers']