Skip to content

Conversation

hakimifr
Copy link
Member

@hakimifr hakimifr commented Mar 23, 2024

Overview

This PR have three important group of commit:

  1. isort: Use isort to sort out imports, and integrate it with pre-commit hook
  2. logging: Logging has been enabled, with coloured output for clarity over different log level
  3. module: I implemented module system, which automatically loads module from files under modules/

Misc

The scripts/add_license.py now open files with explicit encoding for consistency.

Commits

Fri, 22 Mar 2024 22:00:08 +0800 Firdaus Hakimi 43aac25 Add iSort as dev dependency
Fri, 22 Mar 2024 22:02:03 +0800 Firdaus Hakimi 7543cfa isort: Use black's profile for isort
Fri, 22 Mar 2024 22:07:18 +0800 Firdaus Hakimi 60b9b6e scripts: install_hook: Adapt for isort
Fri, 22 Mar 2024 22:08:40 +0800 Firdaus Hakimi 52fdf94 Run isort
Fri, 22 Mar 2024 22:12:18 +0800 Firdaus Hakimi a68d843 README: Adapt for isort
Sat, 23 Mar 2024 13:05:25 +0800 Firdaus Hakimi 9d37bc5 Import coloured logging from https://github.com/Hakimi0804/tgbot-python-V2/blob/main/util/logging.py
Sat, 23 Mar 2024 13:08:08 +0800 Firdaus Hakimi bbfb779 scripts: add_license: Explicitly specify encoding
Sat, 23 Mar 2024 15:16:20 +0800 Firdaus Hakimi 5f64274 Implement module system
Sat, 23 Mar 2024 15:25:36 +0800 Firdaus Hakimi 9d804cc src: Bot: Turn /start into a module
Sat, 23 Mar 2024 20:56:24 +0800 Firdaus Hakimi 2a4c823 YeetAI: Switch back to pyrogram
Sat, 23 Mar 2024 21:11:05 +0800 Firdaus Hakimi 20f62d6 src: Bot: override env with dotenv when possible

* Some system have different default encoding,
  causing traceback

Traceback (most recent call last):
  File "C:\Users\USER\Desktop\YeetAI\scripts\add_license.py", line 54, in <module>
    if add_license_header(file):
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\Desktop\YeetAI\scripts\add_license.py", line 45, in add_license_header
    content = f.read()
              ^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1428: character maps to <undefined>
@hakimifr hakimifr added enhancement Enhancement to existing features new feature New feature(s) labels Mar 23, 2024
@hakimifr hakimifr self-assigned this Mar 23, 2024
Copy link
Member

@prathamdby prathamdby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go!

@prathamdby prathamdby merged commit 6f43dc5 into main Mar 23, 2024
@prathamdby prathamdby deleted the staging/hakimi branch March 23, 2024 17:43
@hakimifr hakimifr restored the staging/hakimi branch March 24, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to existing features new feature New feature(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants