Skip to content

Commit

Permalink
fix cyclic import
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixthrush committed Nov 17, 2024
1 parent b125986 commit 2c1397a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/aniworld/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
setup_autostart,
setup_autoexit,
get_random_anime,
get_windows_version,
check_internet_connection,
show_messagebox,
get_season_episode_count,
Expand Down
19 changes: 16 additions & 3 deletions src/aniworld/common/ascii_art.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import random
import time
import platform

from aniworld.common import get_windows_version

import re

LUCKY_STAR = R"""
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠳⢬⣳⣄⣠⠤⠤⠶⠶⠒⠋⠀⠀⠀⠀⠹⡀⠀⠀⠀⠀⠈⠉⠛⠲⢦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Expand Down Expand Up @@ -805,6 +803,21 @@
"""


def get_windows_version():
platform_version = platform.version()
release = platform.release()

if release != "10":
return "Other"

build_number = int(re.search(r"\d+", platform_version).group())

if build_number >= 22000:
return "Modern"

return "Legacy"


def display_ascii_art() -> str:
options = [
LUCKY_STAR,
Expand Down
15 changes: 0 additions & 15 deletions src/aniworld/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,21 +1257,6 @@ def get_random_anime(genre: str) -> str:
return link


def get_windows_version():
platform_version = platform.version()
release = platform.release()

if release != "10":
return "Other"

build_number = int(re.search(r"\d+", platform_version).group())

if build_number >= 22000:
return "Modern"

return "Legacy"


def check_internet_connection():
# return False # debug
# offline mini game coming soon!
Expand Down

0 comments on commit 2c1397a

Please sign in to comment.