Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output Operation Log #19

Merged
merged 9 commits into from
Feb 1, 2021
Merged

Conversation

yukihirop
Copy link
Owner

@yukihirop yukihirop commented Jan 31, 2021

Summary

Resolve #17

Work

$ bin/gfzs -h
usage: gfzs [-h] [--version] [--score SCORE] [--log-level LOG_LEVEL]
            [--log-path LOG_PATH]
            {init,edit,demo,valid} ...

Google Fuzzy Search. Pipe the search result(json) of googler and use it

optional arguments:
  -h, --help            show this help message and exit
  --version, -v         show program's version number and exit
  --score SCORE, -s SCORE
                        fuzzywuzzy's score (default: 30). please see
                        https://github.com/seatgeek/fuzzywuzzy
  --log-level LOG_LEVEL, -l LOG_LEVEL
                        Log Level (default: 1). [0: DEBUG, 1: INFO, 2: WARN,
                        3: ERROR, 4: FATAL, 5: UNKNOWN, 6: NULL]
  --log-path LOG_PATH, -p LOG_PATH
                        Log Path (default: /Users/yukihirop/gfzs.log)

SubCommands:
  {init,edit,demo,valid}
    init                Initialize gfzs
    edit                Edit config
    demo                Play with Demo
    valid               Validate /Users/yukihirop/.gfzsrc

e.g.) bin/gfzs -l 0 -p ./tmp/gfzs.log valid

D, [2021-02-01T02:51:37.932728#20720] gfzs.cmd.valid -- DEBUG: start gfzs.cmd.valid in /Users/yukihirop/PythonProjects/gfzs/gfzs/cmd/valid.py:50  main
D, [2021-02-01T02:51:37.934607#20720] gfzs.cmd.valid -- DEBUG: [RuntimeConfig] init in /Users/yukihirop/PythonProjects/gfzs/gfzs/runtime/config.py:144  __init__
D, [2021-02-01T02:51:37.935877#20720] gfzs.cmd.valid -- DEBUG: [RuntimeConfig] file is loaded in /Users/yukihirop/PythonProjects/gfzs/gfzs/runtime/config.py:202  _create_data
D, [2021-02-01T02:51:37.936439#20720] gfzs.cmd.valid -- DEBUG: [RuntimeConfig] validate in /Users/yukihirop/PythonProjects/gfzs/gfzs/runtime/config.py:153  valid
D, [2021-02-01T02:51:37.936961#20720] gfzs.cmd.valid -- DEBUG: [RuntimeConfig] is valid in /Users/yukihirop/PythonProjects/gfzs/gfzs/runtime/config.py:190  valid
D, [2021-02-01T02:51:37.937323#20720] gfzs.cmd.valid -- DEBUG: [print] Config is valid. in /Users/yukihirop/PythonProjects/gfzs/gfzs/cmd/valid.py:54  main
D, [2021-02-01T02:51:37.937846#20720] gfzs.cmd.valid -- DEBUG: exit 0 in /Users/yukihirop/PythonProjects/gfzs/gfzs/cmd/valid.py:63  main
D, [2021-02-01T02:51:37.938214#20720] gfzs.cmd.valid -- DEBUG: end gfzs.cmd.valid in /Users/yukihirop/PythonProjects/gfzs/gfzs/cmd/valid.py:64  main
D, [2021-02-01T02:51:37.938573#20720] gfzs.cmd.valid -- DEBUG:

Test

Currently there are no tests.
Instead, the operation is guaranteed by executing the following command and actually checking the operation.

  • python3 gfzs/views/not_found.py
  • python3 gfzs/views/paging.py
  • python3 gfzs/views/footer.py
  • python3 gfzs/views/header.py
  • python3 gfzs/views/search_result.py
  • python3 gfzs/utils/markup.py
  • python3 gfzs/utils/color.py
  • python3 gfzs/runtime/config.py
  • python3 gfzs/cmd/init.py
  • python3 gfzs/cmd/edit.py
  • python3 gfzs/cmd/demo.py
  • python3 gfzs/cmd/valid.py
  • python3 gfzs/controller.py
  • python3 gfzs/model.py
  • cat fixtures/rust.json | bin/gfzs -s 20 -l 0 -p ./tmp/gfzs.log
  • cat fixtures/rust.json | python3 -m gfzs -s 40 -l 0 -p ./tmp/gfzs.log
  • bin/gfzs -l 0 -p ./tmp/gfzs.log init
  • bin/gfzs -l 0 -p ./tmp/gfzs.log edit
  • bin/gfzs -l 0 -p ./tmp/gfzs.log demo
  • bin/gfzs -l 0 -p ./tmp/gfzs.log valid
  • black gfzs/**/*.py

There was a problem that cls._instance could not be shared because the classes were separated depending on the import method.
(インポートの仕方によってクラスが別れてしまいcls._instanceを共有することができない問題があった。)

```
<logger.Logger object at 0x1059250d0>
<utils.logger.Logger object at 0x106698e50>
```
@yukihirop yukihirop added this to the 0.2.3 milestone Jan 31, 2021
@yukihirop yukihirop self-assigned this Jan 31, 2021
@yukihirop yukihirop linked an issue Jan 31, 2021 that may be closed by this pull request
@yukihirop yukihirop force-pushed the issues17/impl_logger_and_use_it branch 2 times, most recently from 8d1f3dd to c423e58 Compare February 1, 2021 14:37
@yukihirop yukihirop force-pushed the issues17/impl_logger_and_use_it branch from c423e58 to 4f9487b Compare February 1, 2021 14:40
@yukihirop
Copy link
Owner Author

LGTM

@yukihirop yukihirop merged commit 72e9e33 into features/0.2.3 Feb 1, 2021
@yukihirop yukihirop deleted the issues17/impl_logger_and_use_it branch February 1, 2021 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output Operation Log
1 participant