for path, subdirs, files in os.walk(self._conf.get("library_path")):
for name in files:
if(fnmatch(name, "*.txt")):
self.source.add(os.path.join(path, name))
for path, subdirs, files in os.walk(self._conf.get("library_path")):
for name in files:
if(fnmatch(name, "*.txt")):
self.source.add(os.path.join(path, name))
for path, subdirs, files in os.walk(self._conf.get("custom_path")):
for name in files:
if(fnmatch(name, "*.txt")):
self.custom.add(os.path.join(path, name))
for path, subdirs, files in os.walk(self._conf.get("custom_path")):
for name in files:
if(fnmatch(name, "*.txt")):
self.custom.add(os.path.join(path, name))
if(not os.path.isdir(self._conf.get("module_path"))):
os.makedirs(self._conf.get("module_path"))
for f in os.listdir(self._conf.get("module_path")):
if(fnmatch(f, "*.module")):
os.unlink(self._conf.get("module_path")+f)
if(not os.path.isdir(self._conf.get("module_path"))):
os.makedirs(self._conf.get("module_path"))
for f in os.listdir(self._conf.get("module_path")):
if(fnmatch(f, "*.module")):
os.unlink(self._conf.get("module_path")+f)
for src in self._sortPriority(self.source):
self._makeModule(src)
for src in self._sortPriority(self.custom):
self._makeModule(src)
def _sortPriority(self, files):
for src in self._sortPriority(self.source):
self._makeModule(src)
for src in self._sortPriority(self.custom):
self._makeModule(src)
def _sortPriority(self, files):
if(m):
ls.append((name.replace("."+m.group(), ""), int(m.group()), addr))
else:
ls.append((name, 100, addr))
if(m):
ls.append((name.replace("."+m.group(), ""), int(m.group()), addr))
else:
ls.append((name, 100, addr))
m=re.search(self.priorityRegex, module)
if(m):
module=module.replace("."+m.group(), "")
m=re.search(self.priorityRegex, module)
if(m):
module=module.replace("."+m.group(), "")
with open(src, "r") as sf, open(modFile, "a") as tf:
with open(src, "r") as sf, open(modFile, "a") as tf:
if(modFlag):
modFlag=False
with open(src, "r") as f:
for line in f:
line=line.strip().split("#")[0]
if(line[1:].replace(" ","").replace("-","").replace("_","").replace("'","").isalnum()):
if(modFlag):
modFlag=False
with open(src, "r") as f:
for line in f:
line=line.strip().split("#")[0]
if(line[1:].replace(" ","").replace("-","").replace("_","").replace("'","").isalnum()):
if(line.startswith("+")):
with open(modFile, "r") as fn:
text=fn.read()
with open(modFile, "w") as fn:
print(self.alias.get(line[1:]).capitalize()+"\n"+text, file=fn)
if(line.startswith("+")):
with open(modFile, "r") as fn:
text=fn.read()
with open(modFile, "w") as fn:
print(self.alias.get(line[1:]).capitalize()+"\n"+text, file=fn)
elif(line.startswith("-")):
with open(modFile, "r") as fn:
text=fn.read()
elif(line.startswith("-")):
with open(modFile, "r") as fn:
text=fn.read()