Transformando a docker

This commit is contained in:
2021-12-13 21:50:55 -03:00
parent 2b0134fff9
commit eebbda99dc
6 changed files with 20 additions and 38 deletions

View File

@@ -5,9 +5,6 @@ import time
import shutil
from pathlib import Path
from markdown import markdown
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
src_dir = Path('src')
out_dir = Path('www')
@@ -75,35 +72,6 @@ def execute():
print('parsing {} as any'.format(path))
process_any(path)
class WatchHandler(PatternMatchingEventHandler):
patterns = ["*.py", "*.md", "*.css", "*.js"]
def process(self, event):
execute()
def on_modified(self, event):
self.process(event)
def on_created(self, event):
self.process(event)
if __name__ == '__main__':
if len(sys.argv) > 1 and sys.argv[1] == '--watch':
observer = Observer()
observer.schedule(WatchHandler(), str(src_dir), recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
else:
execute()
execute()