Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
murphjm committed Feb 3, 2015
1 parent 4695682 commit 65d08fc
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,20 @@ def fixExtension(file):
return newfile

def readConfig(file):
lines=config.read().splitlines()
systems=[]
for line in lines:
if not line.strip() or line[0]=='#':
config = ET.parse(file)
configroot = config.getroot()
for child in configroot:
name = child.find('name').text
path = child.find('path').text
ext = child.find('extension').text
pid = child.find('platformid').text
if not pid:
continue
else:
if "NAME=" in line:
name=line.split('=')[1]
if "PATH=" in line:
path=line.split('=')[1]
elif "EXTENSION" in line:
ext=line.split('=')[1]
elif "PLATFORMID" in line:
pid=line.split('=')[1]
if not pid:
continue
else:
system=(name,path,ext,pid)
systems.append(system)
config.close()
system=(name,path,ext,pid)
systems.append(system)
print name, path, ext, pid
return systems

def crc(fileName):
Expand Down

0 comments on commit 65d08fc

Please sign in to comment.