Skip to content

Commit

Permalink
Merge pull request #75 from theslavicbear/progressbar
Browse files Browse the repository at this point in the history
new progress bar created. closes #69. Nice
  • Loading branch information
theslavicbear authored Jul 17, 2021
2 parents a805692 + b2fd106 commit 5843884
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
8 changes: 0 additions & 8 deletions Ebook-Publisher.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
#!/usr/bin/env python3
#from bs4 import BeautifulSoup
#import requests
#from time import sleep
import sys
from Site import *
import urllib.parse
#try:
from EpubMaker import epub as epub
#from ebooklib import epub
#except:
# print('Warning: No epub filetype support')
import argparse
import os
import threading
import queue
import shutil
from zipfile import ZipFile
from time import sleep

#Master dict of supported sites
sites={
Expand Down
30 changes: 17 additions & 13 deletions Site/Common.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,34 @@ def GetImage(url):
return urllib.request.urlopen(req).read()

class Progress:

size=0


def __init__(self, size):
if quiet:
#size=0
self.it=0
if quiet or mt:
return
self.size=size
sys.stdout.write("[%s]" % (" " * self.size))
sys.stdout.flush()
sys.stdout.write("\b" * (self.size+1))
#sys.stdout.write('\r')
#sys.stdout.write("[%s]" % (" " * self.size))
#sys.stdout.flush()
#sys.stdout.write("\b" * (self.size+1))

def Update(self):
if quiet:
if quiet or mt:
return
sys.stdout.write("=")
self.it+=1
sys.stdout.write('\r')
sys.stdout.write("%d/%d %d%%" % (self.it, self.size, (self.it/self.size)*100))
sys.stdout.flush()


def End(self):
if quiet:
return
if quiet or mt:
return
sys.stdout.write('\n')
sys.stdout.flush()
self.it=0

def RequestSend(url, headers=None):
if headers is None:
Expand All @@ -114,6 +121,3 @@ def RequestPage(url, headers=None):
return None
return response




0 comments on commit 5843884

Please sign in to comment.