Download this file

utils.py    34 lines (28 with data), 655 Bytes

 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
from xml.dom import minidom
class Configuration():
api_key = "qdD49UAt6Heu1pV9vkC0A"
max_number_of_records = 10
class Forges(object):
ALL = 0
#SF = Sourceforge
SF = 1
#FC = Freecode was FM = Freshmeat
FC = 2
#FSF = Free Software Foundation
FSF = 5
#GH = Github
GH = 11
#GC = Google code
GC = 12
OHLOH = 100
CODEPLEX = 1000
APACHE = 1200
ECLIPSE = 1300
class xmlElements():
def __init__(self, xml):
self.xml = xml
def firstValue(self):
try:
return self.xml[0].firstChild.nodeValue
except:
return ""