diff --git a/zero_to_one_hundred/models/map.py b/zero_to_one_hundred/models/map.py index f996d15..435c08d 100644 --- a/zero_to_one_hundred/models/map.py +++ b/zero_to_one_hundred/models/map.py @@ -27,11 +27,14 @@ def __repr__(self): def get_sections(self): + res :List[Section] = self.sections if self.config_map.get_repo_sorted == "abc": - return sorted(self.sections, key=str) + print('*** abc') + res= sorted(self.sections, key=lambda s: s.dir_name) if self.config_map.get_repo_sorted == "00:00:00": - return sorted(self.sections, key=lambda s: s.get_readme_md_time()) - return self.sections + print('*** 00:00:00') + res = sorted(self.sections, key=lambda s: s.get_readme_md_time()) + return res def asMarkDown(self) -> str: lf_char = "\n" diff --git a/zero_to_one_hundred/models/section.py b/zero_to_one_hundred/models/section.py index 266c49e..37683e6 100644 --- a/zero_to_one_hundred/models/section.py +++ b/zero_to_one_hundred/models/section.py @@ -87,7 +87,7 @@ def write_done_section(self): def get_readme_md_time(self): return self.persist_fs.get_biz_ts( - self.config_map.get_repo_path + "/" + self.dir_name + self.dir_readme_md ) @classmethod diff --git a/zero_to_one_hundred/repository/a_persist_fs.py b/zero_to_one_hundred/repository/a_persist_fs.py index 6bd34bb..e733008 100644 --- a/zero_to_one_hundred/repository/a_persist_fs.py +++ b/zero_to_one_hundred/repository/a_persist_fs.py @@ -57,7 +57,7 @@ def make_dirs(cls, path): @classmethod def read_file(cls, filename) -> List[str] | None: - print(f"read_file {filename}") + # print(f"read_file {filename}") lines = None try: with open(filename, mode="r", encoding="UTF-8") as f: diff --git a/zero_to_one_hundred/repository/ztoh_persist_fs.py b/zero_to_one_hundred/repository/ztoh_persist_fs.py index 03a3fdc..64a4091 100644 --- a/zero_to_one_hundred/repository/ztoh_persist_fs.py +++ b/zero_to_one_hundred/repository/ztoh_persist_fs.py @@ -15,7 +15,7 @@ def done_section(cls, path): path = cls.abs_path(path) print(f"done_section {path}") path = path + os.sep + ".done" - print(f"path {path}") + # print(f"path {path}") os.makedirs(path, 0o777, True) with open("{}/.gitkeep".format(path), "a", encoding="utf-8"): os.utime("{}/.gitkeep".format(path), None) @@ -23,11 +23,11 @@ def done_section(cls, path): @classmethod def done_section_status(cls, abs_repo_path, path): - print(f"done_section_status {path}") + # print(f"done_section_status {path}") path = abs_repo_path + os.sep + path + os.sep + ".done" - print(f"path {path}") + # print(f"path {path}") exists = os.path.exists(path) - print(f"exists {exists}") + # print(f"exists {exists}") if exists: return True return False @@ -35,10 +35,12 @@ def done_section_status(cls, abs_repo_path, path): @classmethod def get_biz_ts(cls, path): - print(f"path {path}") + # print(f"path {path}") exists = os.path.exists(path) - print(f"exists {exists}") + # print(f"exists {exists}") if exists: - return os.path.getatime(path) + res = os.path.getmtime(path) + # print(f"time {path} {res}") + return res return time.time()