Menu

[947b1a]: / MySQLdb / setup_common.py  Maximize  Restore  History

Download this file

55 lines (48 with data), 1.6 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
<<<<<<< HEAD
from ConfigParser import SafeConfigParser
=======
try:
# Python 2.x
from ConfigParser import SafeConfigParser
except ImportError:
# Python 3.x
from configparser import ConfigParser as SafeConfigParser
>>>>>>> MySQLdb-1.2
def get_metadata_and_options():
config = SafeConfigParser()
config.read(['metadata.cfg', 'site.cfg'])
metadata = dict(config.items('metadata'))
options = dict(config.items('options'))
<<<<<<< HEAD
metadata['py_modules'] = filter(None, metadata['py_modules'].split('\n'))
metadata['classifiers'] = filter(None, metadata['classifiers'].split('\n'))
=======
metadata['py_modules'] = list(filter(None, metadata['py_modules'].split('\n')))
metadata['classifiers'] = list(filter(None, metadata['classifiers'].split('\n')))
>>>>>>> MySQLdb-1.2
return metadata, options
def enabled(options, option):
value = options[option]
s = value.lower()
if s in ('yes','true','1','y'):
return True
elif s in ('no', 'false', '0', 'n'):
return False
else:
raise ValueError("Unknown value %s for option %s" % (value, option))
def create_release_file(metadata):
rel = open("MySQLdb/release.py",'w')
rel.write("""
<<<<<<< HEAD
"Release data, autogenerated from metadata.cfg by setup_common.create_release_file()"
__author__ = "%(author)s <%(author_email)s>"
version_info = %(version_info)s
__version__ = "%(version)s"
__revision__ = "$ Revision: $"[11:-2]
=======
__author__ = "%(author)s <%(author_email)s>"
version_info = %(version_info)s
__version__ = "%(version)s"
>>>>>>> MySQLdb-1.2
""" % metadata)
rel.close()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.