summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/main.py b/main.py
index a109d2f..f1c3317 100755
--- a/main.py
+++ b/main.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python3
+import argparse
+import os
+
from unbiasedObjects import *
from unbiasedFunctions import *
from parser import *
@@ -7,13 +10,17 @@ import time
def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-w', '--webroot', default='/var/www/ubiased', help='location to write the output html')
+ args = parser.parse_args()
+
while True:
print('-----------------------')
- run()
+ run(args.webroot)
print('-----------------------')
time.sleep(600)
-def run():
+def run(webroot):
sourceList=[]
'''
@@ -25,6 +32,8 @@ def run():
'''
+ print('running with webroot="{}"'.format(webroot))
+
### These values have to be the second half of the function name
### E.g. Guardian calls buildGuardian(), etc.
@@ -54,7 +63,7 @@ def run():
outputHTML=buildOutput(newsSourceArr)
#print the output file HTML
- printOutputHTML(outputHTML, '/var/www/html/index.html')
+ printOutputHTML(outputHTML, os.path.join(webroot, 'index.html'))
if __name__=="__main__":