From 7af319b2157cc3c3c333679e01f1863a17449909 Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Mon, 8 Oct 2018 15:36:40 +0100 Subject: [PATCH 1/3] Fix two string formatting errors --- dropbox-upload/dropbox_upload/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dropbox-upload/dropbox_upload/__main__.py b/dropbox-upload/dropbox_upload/__main__.py index 0098f50..f6d02d8 100644 --- a/dropbox-upload/dropbox_upload/__main__.py +++ b/dropbox-upload/dropbox_upload/__main__.py @@ -32,7 +32,7 @@ def main(config_file, sleeper=time.sleep, DropboxAPI=dropbox.Dropbox): stats = backup.backup(dbx, cfg, snapshots) stats # make pyflakes think stats is used. It doesn't detect fstring usage. LOG.info("Uploads complete") - LOG.info("Total size: {stats['size_human']}") + LOG.info(f"Total size: {stats['size_human']}") limit.limit_snapshots(dbx, cfg, snapshots) LOG.info("Snapshot cleanup complete") @@ -40,7 +40,7 @@ def main(config_file, sleeper=time.sleep, DropboxAPI=dropbox.Dropbox): LOG.exception("Unhandled error") sleep = cfg.get("mins_between_backups", 10) - LOG.info("Sleeping for {sleep} minutes") + LOG.info(f"Sleeping for {sleep} minutes") if sleeper(sleep * 60): return From 68b77dfe90e626da9094f10daf88aaebd169e8e4 Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Mon, 8 Oct 2018 15:37:00 +0100 Subject: [PATCH 2/3] Bump version --- dropbox-upload/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dropbox-upload/config.json b/dropbox-upload/config.json index 46d66c2..0ed3c83 100644 --- a/dropbox-upload/config.json +++ b/dropbox-upload/config.json @@ -1,6 +1,6 @@ { "name": "Dropbox Upload", - "version": "1.0.8", + "version": "1.0.9", "slug": "dropbox_upload", "description": "Upload snapshots to Dropbox!", "startup": "application", From 2cd1f4015292fbee7051c46c507d257333cd283e Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Mon, 8 Oct 2018 15:45:15 +0100 Subject: [PATCH 3/3] Minor logging tweaks --- dropbox-upload/dropbox_upload/backup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dropbox-upload/dropbox_upload/backup.py b/dropbox-upload/dropbox_upload/backup.py index 9e9d1da..51ab1a4 100644 --- a/dropbox-upload/dropbox_upload/backup.py +++ b/dropbox-upload/dropbox_upload/backup.py @@ -60,9 +60,10 @@ def process_snapshot(config, dbx, snapshot): bytes_ = os.path.getsize(path) size = util.bytes_to_human(bytes_) target = str(dropbox_path(config, snapshot)) - LOG.info(f"Slug: {snapshot['slug']} Size: {size}") + LOG.debug(f"Slug: {snapshot['slug']}") + LOG.info(f"Size: {size}") LOG.info(f"Created: {created}") - LOG.info(f"Uploading to: {target}") + LOG.debug(f"Uploading to: {target}") try: if dropbox.file_exists(dbx, path, target): LOG.info("Already found in Dropbox with the same hash")