diff --git a/main.ipynb b/main.ipynb index 32b9778..7769328 100644 --- a/main.ipynb +++ b/main.ipynb @@ -285,11 +285,27 @@ " \n", " oldest_date = datetime.now()\n", "\n", - " if getenv(\"GITHUB_ACTIONS\") == 'true' :\n", - " print('\\n')\n", - " print('/' + '=' * 15 + '\\\\')\n", - " print(' ', end='')\n", - " pqBarsPrinted = 0\n", + " # if getenv(\"GITHUB_ACTIONS\") == 'true' :\n", + " # print('\\n')\n", + " # print('/' + '=' * 15 + '\\\\')\n", + " # print(' ', end='')\n", + " # pqBarsPrinted = 0\n", + " # for i, path in enumerate(paths) :\n", + " # path = join(LEETCODE_PATH_FROM_README, path)\n", + " # output[path] = individualCTimeViaGit(cmd + [path])\n", + " \n", + " # if output[path][0] < oldest_date :\n", + " # oldest_date = output[path][0]\n", + " \n", + " # curChunk = int((i / len(paths)) * 15)\n", + " # if curChunk > pqBarsPrinted :\n", + " # print('=' * (curChunk - pqBarsPrinted), end='')\n", + " # pqBarsPrinted = curChunk\n", + " \n", + " # print((15 - pqBarsPrinted) * '=', '\\n\\n')\n", + " # else :\n", + " with tqdm(total=len(paths)) as pbar :\n", + " # with tqdm(total=len(paths), position=0, leave=True) as pbar :\n", " for i, path in enumerate(paths) :\n", " path = join(LEETCODE_PATH_FROM_README, path)\n", " output[path] = individualCTimeViaGit(cmd + [path])\n", @@ -297,23 +313,7 @@ " if output[path][0] < oldest_date :\n", " oldest_date = output[path][0]\n", " \n", - " curChunk = int((i / len(paths)) * 15)\n", - " if curChunk > pqBarsPrinted :\n", - " print('=' * (curChunk - pqBarsPrinted), end='')\n", - " pqBarsPrinted = curChunk\n", - " \n", - " print((15 - pqBarsPrinted) * '=', '\\n\\n')\n", - " else :\n", - " with tqdm(total=len(paths)) as pbar :\n", - " # with tqdm(total=len(paths), position=0, leave=True) as pbar :\n", - " for i, path in enumerate(paths) :\n", - " path = join(LEETCODE_PATH_FROM_README, path)\n", - " output[path] = individualCTimeViaGit(cmd + [path])\n", - " \n", - " if output[path][0] < oldest_date :\n", - " oldest_date = output[path][0]\n", - " \n", - " pbar.update(1)\n", + " pbar.update(1)\n", "\n", " global _oldest_date\n", " _oldest_date = oldest_date.replace(hour=0, minute=0, second=0, microsecond=0)\n", diff --git a/main.py b/main.py index bfd1ffa..d0da901 100644 --- a/main.py +++ b/main.py @@ -217,11 +217,27 @@ def getAllCTimesViaGit(paths: List[str]) -> Dict[str, Tuple[datetime, datetime]] oldest_date = datetime.now() - if getenv("GITHUB_ACTIONS") == 'true' : - print('\n') - print('/' + '=' * 15 + '\\') - print(' ', end='') - pqBarsPrinted = 0 + # if getenv("GITHUB_ACTIONS") == 'true' : + # print('\n') + # print('/' + '=' * 15 + '\\') + # print(' ', end='') + # pqBarsPrinted = 0 + # for i, path in enumerate(paths) : + # path = join(LEETCODE_PATH_FROM_README, path) + # output[path] = individualCTimeViaGit(cmd + [path]) + + # if output[path][0] < oldest_date : + # oldest_date = output[path][0] + + # curChunk = int((i / len(paths)) * 15) + # if curChunk > pqBarsPrinted : + # print('=' * (curChunk - pqBarsPrinted), end='') + # pqBarsPrinted = curChunk + + # print((15 - pqBarsPrinted) * '=', '\n\n') + # else : + with tqdm(total=len(paths)) as pbar : + # with tqdm(total=len(paths), position=0, leave=True) as pbar : for i, path in enumerate(paths) : path = join(LEETCODE_PATH_FROM_README, path) output[path] = individualCTimeViaGit(cmd + [path]) @@ -229,23 +245,7 @@ def getAllCTimesViaGit(paths: List[str]) -> Dict[str, Tuple[datetime, datetime]] if output[path][0] < oldest_date : oldest_date = output[path][0] - curChunk = int((i / len(paths)) * 15) - if curChunk > pqBarsPrinted : - print('=' * (curChunk - pqBarsPrinted), end='') - pqBarsPrinted = curChunk - - print((15 - pqBarsPrinted) * '=', '\n\n') - else : - with tqdm(total=len(paths)) as pbar : - # with tqdm(total=len(paths), position=0, leave=True) as pbar : - for i, path in enumerate(paths) : - path = join(LEETCODE_PATH_FROM_README, path) - output[path] = individualCTimeViaGit(cmd + [path]) - - if output[path][0] < oldest_date : - oldest_date = output[path][0] - - pbar.update(1) + pbar.update(1) global _oldest_date _oldest_date = oldest_date.replace(hour=0, minute=0, second=0, microsecond=0)