Skip to content

Commit

Permalink
Merge pull request #262 from ppfeufer/constants
Browse files Browse the repository at this point in the history
[CHANGE] Better constant names
  • Loading branch information
ppfeufer authored Mar 2, 2025
2 parents 7f00ab0 + 4278d11 commit eccc11f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Section Order:

### Changed

- Better constant names
- Code for the template tag has been improved

### Removed
Expand Down
4 changes: 2 additions & 2 deletions fleetpings/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

DISCORD_WEBHOOK_REGEX = r"https:\/\/discord\.com\/api\/webhooks\/[\d]+\/[a-zA-Z0-9_-]+$"

AA_FLEETPINGS_BASE_DIR = os.path.join(os.path.dirname(__file__))
AA_FLEETPINGS_STATIC_DIR = os.path.join(AA_FLEETPINGS_BASE_DIR, "static", PACKAGE_NAME)
APP_BASE_DIR = os.path.join(os.path.dirname(__file__))
APP_STATIC_DIR = os.path.join(APP_BASE_DIR, "static", PACKAGE_NAME)
4 changes: 2 additions & 2 deletions fleetpings/helper/static_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# AA Fleet Pings
from fleetpings import __title__
from fleetpings.constants import AA_FLEETPINGS_STATIC_DIR
from fleetpings.constants import APP_STATIC_DIR

logger = LoggerAddTag(my_logger=get_extension_logger(__name__), prefix=__title__)

Expand All @@ -34,7 +34,7 @@ def calculate_integrity_hash(relative_file_path: str) -> str:
:rtype: str
"""

file_path = os.path.join(AA_FLEETPINGS_STATIC_DIR, relative_file_path)
file_path = os.path.join(APP_STATIC_DIR, relative_file_path)
integrity_hash = calculate_integrity(Path(file_path), Algorithm.SHA512)

return integrity_hash

0 comments on commit eccc11f

Please sign in to comment.