home
·
contact
·
privacy
projects
/
url-catcher
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:plomlompom/url-catcher
[url-catcher]
/
url_catcher.py
diff --git
a/url_catcher.py
b/url_catcher.py
old mode 100644
(file)
new mode 100755
(executable)
index
ac4b7a7
..
0121896
--- a/
url_catcher.py
+++ b/
url_catcher.py
@@
-1,3
+1,5
@@
+#!/usr/bin/python3
+
import bottle
import validators
import html
import bottle
import validators
import html
@@
-47,7
+49,7
@@
os.makedirs(lists_dir, exist_ok=True)
def atomic_write(path, content, mode):
"""Atomic write/append to file."""
_, tmpPath = tempfile.mkstemp()
def atomic_write(path, content, mode):
"""Atomic write/append to file."""
_, tmpPath = tempfile.mkstemp()
- if 'a' == mode:
+ if 'a' == mode
and os.path.exists(path)
:
shutil.copy2(path, tmpPath)
f = open(tmpPath, mode)
f.write(content)
shutil.copy2(path, tmpPath)
f = open(tmpPath, mode)
f.write(content)