Exclude dot files from modules list to be loaded

pull/2/head
Alexandre Dulaunoy 2016-03-09 07:39:29 +01:00
parent e0d8462227
commit 0284aee1a2
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import tornado.web
import importlib
import json
import logging
import re
runPath = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(runPath, '..'))
@ -46,6 +47,8 @@ modules = []
for module in os.listdir(modulesdir):
if ".py" not in module or ".pyc" in module:
continue
if re.match("^\.", module):
continue
modulename = module.split(".")[0]
moduletype = os.path.split(modulesdir)[1]
modules.append(modulename)