Browse Source

More style fixes + note on logging

debianarchive-update
Merlijn Wajer 6 years ago
parent
commit
1226778224
  1. 4
      amprolla-init
  2. 3
      lib/log.py
  3. 5
      lib/net.py

4
amprolla-init

@ -9,10 +9,10 @@ import lib.config as config
import lib.delta as delta
import lib.fs as fs
import lib.net as net
from lib.log import die, notice, warn, cleanexit
from lib.log import notice, warn
def popDirs():
def pop_dirs():
paths = fs.crawl()
notice("creating initial directory structure")

3
lib/log.py

@ -2,6 +2,9 @@
# copyright (c) 2017 - Ivan J. <parazyd@dyne.org>
# see LICENSE file for copyright and license details
# TODO: Replace with logging
import sys

5
lib/net.py

@ -4,7 +4,6 @@
import requests
import config
from log import die, notice, warn, cleanexit
@ -12,10 +11,10 @@ def download(url, path):
print("\tdownloading: %s\n\tto: %s" % (url, path))
r = requests.get(url, stream=True)
if r.status_code == 404:
warn("not found!")
warn("download of %s failed: not found!", url)
return
elif r.status_code != 200:
die("fail!")
die("download of %s failed", url)
with open(path, "wb") as f:
# XXX: should be more on gbit servers

Loading…
Cancel
Save