Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new progress bar created. closes #69. Nice #75

Merged
merged 1 commit into from
Jul 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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