Delete all useless print() functions

parent c5360b50
......@@ -94,9 +94,8 @@ class ConfigReader:
@staticmethod
def parse_yaml(file_dir):
return_list = []
#print('file_dir is', file_dir)
yaml_dir = os.path.dirname(os.path.abspath(file_dir))
print('yaml_dir from parse_yaml', yaml_dir)
with open(file_dir, 'r') as stream:
data = load(stream, Loader=Loader)
for project in data.get("projects"):
......@@ -104,7 +103,7 @@ class ConfigReader:
rel_map_path = os.path.relpath(map_path, start=yaml_dir)
abs_map_path = os.path.join(rel_map_path, yaml_dir, os.path.basename(map_path))
abs_map_path = os.path.normpath(abs_map_path)
print('abs_map_path from parse_yaml', abs_map_path)
project_prefix = project.get("prefix")
return_list.append((abs_map_path, project_prefix))
return return_list
......
......@@ -50,11 +50,10 @@ class RedirectorWatch:
super().__init__(*args, **kwargs)
def process_IN_MODIFY(self, event):
print('event is', event)
try:
redirector_watch.pool[yaml_file][1].stop()
except RuntimeError as e:
print("hello there")
print("There is a non cricital Exception {}".format(e))
redirector_watch.pool[yaml_file] = None
print("Proccessing...")
self.redirector.generate(yaml_file, event.pathname)
......@@ -74,14 +73,11 @@ class RedirectorWatch:
# we suggest that self.watch_manager already exists
def set_inotify(self, yaml_file, Watch_class):
print('trying to set_inotify on {}'.format(yaml_file))
wm = pyinotify.WatchManager()
self.add_files(yaml_file, wm)
notifier = pyinotify.ThreadedNotifier(wm, Watch_class(redirector=self.redirector))
notifier.start()
self.pool[yaml_file] = [wm, notifier]
#print('self.pool is', self.pool)
#print('notifier is', notifier)
def add_files(self, file_, wm):
file_list = self.parser.parse_yaml(file_)
......
# comment
/some-page /another-page
/old-page /new-page
/very-old-page /very-new-page
# regexp
~^assets/(.+) /new-assets/$1
......
......@@ -3,5 +3,5 @@ projects:
prefix: /test
- map: /home/kantegory/pvt/nginx-redirector/tests/test2.map
prefix: /test
prefix: /test2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment