aboutsummaryrefslogtreecommitdiffstats
path: root/settings.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-07-13 15:51:04 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-07-13 15:51:04 -0700
commit12382d5205fa3ba38f0dad8df8e4fc266ba01f29 (patch)
treef38bb259cafa4d248e63d81f3b01eeb0d0268530 /settings.py
parentc3b9f8c4582882cd1f768b0727eca75475bb4f94 (diff)
downloadyt-local-12382d5205fa3ba38f0dad8df8e4fc266ba01f29.tar.lz
yt-local-12382d5205fa3ba38f0dad8df8e4fc266ba01f29.tar.xz
yt-local-12382d5205fa3ba38f0dad8df8e4fc266ba01f29.zip
move settings to file, fix error if no banned_addresses.txt
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/settings.py b/settings.py
new file mode 100644
index 0000000..499b32b
--- /dev/null
+++ b/settings.py
@@ -0,0 +1,11 @@
+default_settings = '''route_tor = False
+port_number = 80
+allow_foreign_addresses = False
+'''
+exec(default_settings)
+try:
+ with open('settings.txt', 'r', encoding='utf-8') as file:
+ exec(file.read())
+except FileNotFoundError:
+ with open('settings.txt', 'a', encoding='utf-8') as file:
+ file.write(default_settings) \ No newline at end of file