|
a/OSSEval/OpenSourceProject/models.py |
|
b/OSSEval/OpenSourceProject/models.py |
|
... |
|
... |
16 |
|
16 |
|
17 |
from django.db import models
|
17 |
from django.db import models
|
18 |
|
18 |
|
19 |
from ohloh import OhlohProxy
|
19 |
from ohloh import OhlohProxy
|
20 |
from flossmole import FSF, FC, GC, GH
|
20 |
from flossmole import FSF, FC, GC, GH
|
|
|
21 |
from doap import Apache, Eclipse
|
21 |
from utils import Forges
|
22 |
from utils import Forges
|
22 |
from OSSEval.utils import xmlMinidom
|
23 |
from OSSEval.utils import xmlMinidom
|
23 |
|
24 |
|
24 |
class OSProject(models.Model):
|
25 |
class OSProject(models.Model):
|
25 |
"""
|
26 |
"""
|
|
... |
|
... |
54 |
i['FM']
|
55 |
i['FM']
|
55 |
i['OHLOH']
|
56 |
i['OHLOH']
|
56 |
i['FSF']
|
57 |
i['FSF']
|
57 |
i['GC']
|
58 |
i['GC']
|
58 |
i['GH']
|
59 |
i['GH']
|
|
|
60 |
i['Apache']
|
|
|
61 |
i['Eclipse']
|
59 |
...
|
62 |
...
|
60 |
Some information is extracted from specific sources and made available at root level; e.g.
|
63 |
Some information is extracted from specific sources and made available at root level; e.g.
|
61 |
i['days'] number of days since the project has been registered; it is calculated using i['FM']['date_added'] or i['OHLOH']['created_at']
|
64 |
i['days'] number of days since the project has been registered; it is calculated using i['FM']['date_added'] or i['OHLOH']['created_at']
|
62 |
...
|
65 |
...
|
63 |
'''
|
66 |
'''
|
|
... |
|
... |
112 |
except: pass
|
115 |
except: pass
|
113 |
try:
|
116 |
try:
|
114 |
i['download_url'] = i['OHLOH']['download_url']
|
117 |
i['download_url'] = i['OHLOH']['download_url']
|
115 |
except: pass
|
118 |
except: pass
|
116 |
|
119 |
|
|
|
120 |
# Licenses
|
|
|
121 |
i['licenses'] = []
|
|
|
122 |
try:
|
|
|
123 |
i['licenses'] += i['OHLOH']['licenses']
|
|
|
124 |
except: pass
|
|
|
125 |
try:
|
|
|
126 |
i['licenses'] += i['Apache']['doap']['license']
|
|
|
127 |
except: pass
|
|
|
128 |
|
|
|
129 |
|
117 |
# CLEANUP
|
130 |
# CLEANUP
|
118 |
try: i['FM']['popularity_score'] = (i['FM']['popularity_score']).replace('\n','').strip()
|
131 |
try: i['FM']['popularity_score'] = (i['FM']['popularity_score']).replace('\n','').strip()
|
119 |
except: pass
|
132 |
except: pass
|
120 |
try: i['FM']['rating'] = (i['FM']['rating']).replace('\n','').strip()
|
133 |
try: i['FM']['rating'] = (i['FM']['rating']).replace('\n','').strip()
|
121 |
except: pass
|
134 |
except: pass
|
|
... |
|
... |
182 |
osprojectforge_info = FSF.getProjectInfo(self.identifier_in_forge)
|
195 |
osprojectforge_info = FSF.getProjectInfo(self.identifier_in_forge)
|
183 |
if self.forge.id == Forges.GC:
|
196 |
if self.forge.id == Forges.GC:
|
184 |
osprojectforge_info = GC.getProjectInfo(self.identifier_in_forge)
|
197 |
osprojectforge_info = GC.getProjectInfo(self.identifier_in_forge)
|
185 |
if self.forge.id == Forges.GH:
|
198 |
if self.forge.id == Forges.GH:
|
186 |
osprojectforge_info = GH.getProjectInfo(self.identifier_in_forge)
|
199 |
osprojectforge_info = GH.getProjectInfo(self.identifier_in_forge)
|
|
|
200 |
if self.forge.id == Forges.APACHE:
|
|
|
201 |
osprojectforge_info = Apache.getProjectInfo(self.identifier_in_forge)
|
|
|
202 |
if self.forge.id == Forges.ECLIPSE:
|
|
|
203 |
osprojectforge_info = Eclipse.getProjectInfo(self.identifier_in_forge)
|
187 |
return osprojectforge_info
|
204 |
return osprojectforge_info
|
188 |
|
205 |
|