Add parseComments argument to readList
This commit is contained in:
parent
2443494ac0
commit
88ae0029d6
|
@ -19,13 +19,14 @@ def findAll(path,method = os.path.isfile):
|
|||
if method(fp): rtn.append(fp)
|
||||
return rtn
|
||||
|
||||
def readList(path):
|
||||
def readList(path,parseComments = True):
|
||||
with open(path,encoding="utf-8") as f:
|
||||
content = f.read().replace("\r","").strip("\n").split("\n")
|
||||
index = 0
|
||||
length = len(content)
|
||||
while index < length:
|
||||
line = content[index]
|
||||
if parseComments: line = line.split("#",1)[0]
|
||||
line.strip("\t ")
|
||||
if line == "":
|
||||
del content[index]
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
userModules
|
||||
userModules
|
||||
#title
|
Loading…
Reference in New Issue