better progress bar, implements #9
This commit is contained in:
parent
0a4a4d6d9d
commit
51021d726b
1 changed files with 13 additions and 3 deletions
16
siglican.py
16
siglican.py
|
@ -20,6 +20,8 @@
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import locale
|
import locale
|
||||||
|
@ -210,17 +212,23 @@ class SigalGalleryGenerator(Generator):
|
||||||
# github8 ** re-integrate multiprocessing logic from Sigal
|
# github8 ** re-integrate multiprocessing logic from Sigal
|
||||||
|
|
||||||
# generate thumbnails, process images, and move them to the destination
|
# generate thumbnails, process images, and move them to the destination
|
||||||
|
if logger.getEffectiveLevel() > logging.INFO:
|
||||||
|
print('siglican is processing media: ', end='')
|
||||||
|
sys.stdout.flush()
|
||||||
albums = self.albums
|
albums = self.albums
|
||||||
for a in albums:
|
for a in albums:
|
||||||
logger.debug("siglican: creating directory for %s",a)
|
logger.info("siglican: processing album: %s",a)
|
||||||
albums[a].create_output_directories()
|
albums[a].create_output_directories()
|
||||||
for media in albums[a].medias:
|
for media in albums[a].medias:
|
||||||
logger.debug("siglican: processing %r , source: %s, dst: %s",
|
if logger.getEffectiveLevel() > logging.INFO:
|
||||||
media,media.src_path,media.dst_path)
|
print('.', end='')
|
||||||
|
sys.stdout.flush()
|
||||||
if os.path.isfile(media.dst_path):
|
if os.path.isfile(media.dst_path):
|
||||||
logger.info("siglican: %s exists - skipping", media.filename)
|
logger.info("siglican: %s exists - skipping", media.filename)
|
||||||
self.stats[media.type + '_skipped'] += 1
|
self.stats[media.type + '_skipped'] += 1
|
||||||
else:
|
else:
|
||||||
|
logger.info("siglican: processing %r , source: %s, dst: %s",
|
||||||
|
media,media.src_path,media.dst_path)
|
||||||
self.stats[media.type] += 1
|
self.stats[media.type] += 1
|
||||||
logger.debug("MEDIA TYPE: %s",media.type)
|
logger.debug("MEDIA TYPE: %s",media.type)
|
||||||
# create/move resized images and thumbnails to output dirs:
|
# create/move resized images and thumbnails to output dirs:
|
||||||
|
@ -230,6 +238,8 @@ class SigalGalleryGenerator(Generator):
|
||||||
elif media.type == 'video':
|
elif media.type == 'video':
|
||||||
process_video(media.src_path,os.path.dirname(
|
process_video(media.src_path,os.path.dirname(
|
||||||
media.dst_path),self.settings)
|
media.dst_path),self.settings)
|
||||||
|
if logger.getEffectiveLevel() > logging.INFO:
|
||||||
|
print('')
|
||||||
|
|
||||||
# generate the index.html files for the albums
|
# generate the index.html files for the albums
|
||||||
if self.settings['SIGLICAN_WRITE_HTML']: # defaults to True
|
if self.settings['SIGLICAN_WRITE_HTML']: # defaults to True
|
||||||
|
|
Loading…
Reference in a new issue