Created
November 24, 2014 14:13
-
-
Save rebrec/273d9a46915aef686f9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- codding:utf-8 -*- | |
from xml.dom import minidom | |
import os.path | |
# The top argument for walk. The | |
# Python27/Lib/site-packages folder in my case | |
topdir="C:\\Users\\frlam\\Desktop\\Conf BIRDY WP" | |
# The arg argument for walk, and subsequently ext for step | |
exten = '.birdyW.xml' | |
def perteReseauFromFile(strFile): | |
#strFile = strFile.replace('\\','/') # not working either | |
res = [] | |
doc = minidom.parse(strFile) | |
print strFile | |
inactive = doc.getElementsByTagName("networkLostTempo") | |
if inactive == []: | |
inactive = doc.getElementsByTagName("POCSAGSurvey") | |
res =inactive.firstChild.nodeValue | |
print res | |
return res | |
def step(ext, dirname, names): | |
ext = ext.lower() | |
for name in names: | |
if name.lower().endswith(ext): | |
f=os.path.join(dirname, name) | |
print(f) | |
print extractEpromDataFromFile(f) | |
# Start the walk | |
os.path.walk(topdir, step, exten) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment