Index

s3-bsync / c693349

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
622 Oct 2021 11:139613f30Update Python project toolsJosh Stockin1242G

Blob @ s3-bsync / src / __main__.py

application/x-python1183 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 s3_bsync
17
18logger = logging.getLogger(__name__)
19
20
21def main():
22 args = s3_bsync.command_parse.command_parse(sys.argv[1:])
23
24 logLevel = logging.INFO
25 if args.debug:
26 logLevel = logging.DEBUG
27
28 logging.basicConfig(
29 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",
30 datefmt="%H:%M:%S",
31 level=logLevel,
32 )
33
34 logger.debug(f"Parsed input arguments: {vars(args)}")
35 logger.debug("Sanitizing input arguments")
36 args = s3_bsync.command_parse.sanitize_arguments(args)
37
38 return 0
39
40
41if __name__ == "__main__":
42 sys.exit(main() or 0)
43