Commit 255d21e1 authored by Alexandre Dulaunoy's avatar Alexandre Dulaunoy
Browse files

Merge pull request #80 from PidgeyL/master

Fix progress bar issue
parents d5032143 e97ee14c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ def progressbar(it, prefix="Preparing ", size=50):
    count = len(it)

    def _show(_i):
        if count != 0:
        if count != 0 and sys.stdout.isatty():
            x = int(size * _i / count)
            sys.stdout.write("%s[%s%s] %i/%i\r" % (prefix, "#" * x, " " * (size - x), _i, count))
            sys.stdout.flush()
+1 −2
Original line number Diff line number Diff line
@@ -477,8 +477,7 @@ def admin():
def updatedb():
    process = subprocess.Popen(["python3", os.path.join(_runPath, "../sbin/db_updater.py"), "-civ"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = process.communicate()
    oList=[x for x in str(out,'utf-8').split("\r") if not x.startswith("Preparing")]
    output="%s\n\nErrors:\n%s"%(oList[0],str(err,'utf-8')) if err else oList[0]
    output="%s\n\nErrors:\n%s"%(oList[0],str(err,'utf-8')) if err else str(out,'utf-8')
    status = ["db_updated", "success"]
    return render_template('admin.html', status=status, stats=adminStats(), updateOutput=output)