Index

s3-bsync / a3ba179

Bidirectional syncing tool to sync local filesystem directories with S3 buckets. (Incomplete)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1016 Jun 2022 12:0894fa0b0Clean up repo, begin work on class abstraction and serializationJosh Stockin131G

Blob @ s3-bsync / src / __main__.py

application/x-python1215 bytesdownload raw
1#!/usr/bin/env python3
2# s3-bsync Copyright (c) 2021 Joshua Stockin
3# <https://joshstock.in>
4# <https://git.joshstock.in/s3-bsync>
5#
6# This software is licensed and distributed under the terms of the MIT License.
7# See the MIT License in the LICENSE file of this project's root folder.
8#
9# This comment block and its contents, including this disclaimer, MUST be
10# preserved in all copies or distributions of this software's source.
11
12import sys
13
14import logging
15
16import pprint
17
18import s3_bsync
19
20logger = logging.getLogger(__name__)
21
22
23def main():
24 args = s3_bsync.command_parse.command_parse(sys.argv[1:])
25
26 logLevel = logging.INFO
27 if args.debug:
28 logLevel = logging.DEBUG
29
30 logging.basicConfig(
31 format="\x1b[0;37m[ \x1b[0;35m%(relativeCreated)04d \x1b[0;37m/ \x1b[0;33m%(name)s\x1b[0;37m:\x1b[1;36m%(funcName)s \x1b[0;37m/ \x1b[0;34m%(levelname)s \x1b[0;37m] \x1b[0m%(message)s",
32 datefmt="%H:%M:%S",
33 level=logLevel,
34 )
35
36 logger.debug(f"Parsed input arguments:\n{pprint.pformat(vars(args))}")
37 logger.debug("Sanitizing input arguments")
38 args = s3_bsync.command_parse.sanitize_arguments(args)
39
40 return 0
41
42
43if __name__ == "__main__":
44 sys.exit(main() or 0)
45