src.co_tools.get_dir_contents

 1#!/usr/bin/env python
 2import os
 3import sys
 4
 5from .co_utils import get_dir_contents
 6
 7if os.getenv("CO_LOG").lower() == "true":
 8    from .get_logger import LOGGER
 9
10    log = LOGGER
11else:
12    import logging
13
14    log = logging.getLogger(__name__)
15
16
17def main(argv=sys.argv):
18    log.debug(f"args: {sys.argv}")
19    if len(argv) > 1:
20        print(
21            f"*** These are the current files in the {argv[1]} directory\n"
22            + f"{get_dir_contents(argv[1])}"
23        )
24        return 0
25    print(
26        "*** These are the current files in the ../data directory\n"
27        + f"{get_dir_contents()}"
28    )
29    return 0
30
31
32if __name__ == "__main__":
33    log.debug(f"args: {sys.argv}")
34    sys.exit(main(sys.argv))
def main( argv=['/home/zappuf/.local/bin/pdoc', 'src/co_tools/', '-o', 'docs/']):
18def main(argv=sys.argv):
19    log.debug(f"args: {sys.argv}")
20    if len(argv) > 1:
21        print(
22            f"*** These are the current files in the {argv[1]} directory\n"
23            + f"{get_dir_contents(argv[1])}"
24        )
25        return 0
26    print(
27        "*** These are the current files in the ../data directory\n"
28        + f"{get_dir_contents()}"
29    )
30    return 0