-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
29 changed files
with
237 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
#!/usr/bin/env python3 | ||
# coding: utf-8 | ||
|
||
from enum import Enum | ||
import sys | ||
import logging | ||
|
||
from zero_to_one_hundred.exceptions.errors import UnsupportedOptionError | ||
from zero_to_one_hundred.runner import run_core | ||
|
||
from zero_to_one_hundred.validator.validator import Validator | ||
|
||
if __name__ == "__main__": | ||
logger = logging.getLogger(__name__) | ||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') | ||
|
||
err_msg = f'zt or sb available, passed {str(sys.argv)}' | ||
try: | ||
arg1= sys.argv[1] | ||
match arg1: | ||
case 'zt': | ||
from zero_to_one_hundred.factories.ztoh_factory_provider import ZTOHFactoryProvider | ||
from zero_to_one_hundred.repository.ztoh_persist_fs import ZTOHPersistFS as persist_fs | ||
from zero_to_one_hundred.repository.ztoh_process_fs import ZTOHProcessFS as process_fs | ||
from zero_to_one_hundred.factories.ztoh_factory_provider import ZTOHFactoryProvider | ||
run_core(sys.argv, ZTOHFactoryProvider(persist_fs, process_fs)) | ||
case 'sb': | ||
from zero_to_one_hundred.factories.sb_factory_provider import SBFactoryProvider | ||
from zero_to_one_hundred.repository.sb_persist_fs import SBPersistFS as persist_fs | ||
from zero_to_one_hundred.repository.sb_process_fs import SBProcessFS as process_fs | ||
from zero_to_one_hundred.factories.sb_factory_provider import SBFactoryProvider | ||
run_core(sys.argv, SBFactoryProvider(persist_fs, process_fs)) | ||
case _: | ||
raise ValueError(err_msg) | ||
except Exception as e: | ||
logging.info(err_msg) | ||
raise ValueError | ||
except (ValueError,IndexError, TypeError,UnsupportedOptionError): | ||
from zero_to_one_hundred.repository.a_persist_fs import APersistFS as persist_fs | ||
from zero_to_one_hundred.factories.a_factory_provider import AFactoryProvider | ||
run_core(sys.argv, AFactoryProvider(persist_fs)) | ||
except Exception as e: | ||
Validator.print_e(e) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
# TOC | ||
## `2` metabook | ||
### 2024/09/13-11:06:37 | ||
|
||
## legend: | ||
|
||
**legend_icons** | ||
`Book` :cyclone: | ||
|
||
| ISBN | img | `meta-contents` | `json-contents` | `status` | `icons` | ||
|--- |--- |--- |--- |--- |--- | | ||
|<span style="color:blue">**9780134661742**</span>||[`xyz`](./9780134661742/)|{'isbn': '9780134661742',<br/> 'pages_perc': 'n/a',<br/> 'title': 'Clean Code Fundamentals',<br/> 'url': '> https://learning.oreilly.com/library/9780134661742 <'}|<span style="color:yellow">**WIP**</span>|:cyclone:| | ||
|<span style="color:blue">**9781119895947**</span>||[`xyz`](./9781119895947/)|{'isbn': '9781119895947',<br/> 'page_curr': '100',<br/> 'page_tot': '100',<br/> 'pages_perc': '100.0%',<br/> 'url': '> https://www.oreilly.com/library/view/rewire-your-brain/9781119895947 <'}|<span style="color:green">**DONE**</span>|:cyclone:| | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# map toc.md, 6 | ||
|
||
## legend: | ||
|
||
**legend_icons** | ||
`Path` :cyclone: | ||
`Lab` :floppy_disk: | ||
`Template` :whale: | ||
`Game` :snake: | ||
`Course` :pushpin: | ||
|
||
1. # <https§§§www.cloudskillsboost.google§paths§16> [`here`](./0to100/https§§§www.cloudskillsboost.google§paths§16/readme.md) `wip` :cyclone: | ||
1. # <https§§§www.cloudskillsboost.google§games§4424§labs§28651> [`here`](./0to100/https§§§www.cloudskillsboost.google§games§4424§labs§28651/readme.md) `wip` :floppy_disk: :snake: | ||
1. # <https§§§www.cloudskillsboost.google§course_templates§3> [`here`](./0to100/https§§§www.cloudskillsboost.google§course_templates§3/readme.md) `wip` :whale: :pushpin: | ||
1. # <https§§§www.cloudskillsboost.google§games§4422> [`here`](./0to100/https§§§www.cloudskillsboost.google§games§4422/readme.md) `wip` :snake: | ||
1. # <https§§§storage.googleapis.com§cloud-training§cls-html5-courses§T-BQRS-I§M1§index.html> [`here`](./0to100/https§§§storage.googleapis.com§cloud-training§cls-html5-courses§T-BQRS-I§M1§index.html/readme.md) `wip` :pushpin: | ||
1. # a_custom_header 0 [`here`](./0to100/https§§§www.cloudskillsboost.google§0/readme.md) `done` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
from abc import ABC, abstractmethod | ||
from enum import Enum | ||
from typing import Generator | ||
|
||
from zero_to_one_hundred.processors.a_processor import AProcessor | ||
from zero_to_one_hundred.processors.help_processor import HelpProcessor | ||
from zero_to_one_hundred.processors.unsupported_processor import UnsupportedProcessor | ||
from zero_to_one_hundred.repository.a_persist_fs import APersistFS | ||
|
||
|
||
class AFactory(ABC): | ||
class AFactory: | ||
"""AFactory class.""" | ||
|
||
class SUPPORTED_PROCESSOR(Enum): | ||
help = 1 | ||
zt = 1 | ||
sb = 2 | ||
help = 3 | ||
|
||
@abstractmethod | ||
def get_processor(self, args) -> Generator[AProcessor, None, None]: | ||
pass | ||
extended_help = """ | ||
zt = zero to 100 | ||
./main.py zt help | ||
sb = sb to 100 | ||
./main.py sb help | ||
help = this :) | ||
./main.py help | ||
""" | ||
|
||
def __init__(self, persist_fs: APersistFS): | ||
self.persist_fs = persist_fs | ||
|
||
def get_processor(self,args) -> Generator[AProcessor, None, None]: | ||
yield self.help_processor() | ||
|
||
def help_processor(self): | ||
return HelpProcessor( | ||
None, self.persist_fs, self.SUPPORTED_PROCESSOR, self.extended_help | ||
) | ||
|
||
@staticmethod | ||
def unsupported_processor(cmd): | ||
return UnsupportedProcessor(cmd) | ||
def unsupported_processor(cmd, supp): | ||
return UnsupportedProcessor(cmd, supp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from zero_to_one_hundred.factories.a_factory import AFactory | ||
from zero_to_one_hundred.repository.a_persist_fs import APersistFS | ||
|
||
|
||
class AFactoryProvider(ABC): | ||
class AFactoryProvider: | ||
"""AFactoryProvider.""" | ||
|
||
@abstractmethod | ||
def __init__(self, persist_fs: APersistFS, process_fs): | ||
pass | ||
def __init__(self, persist_fs=None, process_fs=None): | ||
self.persist_fs = persist_fs | ||
self.process_fs = process_fs | ||
|
||
@abstractmethod | ||
def provide(self) -> None | AFactory: | ||
pass | ||
return AFactory(persist_fs=self.persist_fs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import string | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters