weeb-cli 0.0.1__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weeb-cli
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Tarayıcı yok, reklam yok, dikkat dağıtıcı unsur yok. Sadece siz ve eşsiz bir anime izleme deneyimi.
5
5
  Author-email: ewgsta <ewgst@proton.me>
6
- License: CC-BY-NC-ND-4.0
6
+ License-Expression: CC-BY-NC-ND-4.0
7
7
  Project-URL: Homepage, https://github.com/ewgsta/weeb-cli
8
8
  Project-URL: Repository, https://github.com/ewgsta/weeb-cli
9
9
  Project-URL: Issues, https://github.com/ewgsta/weeb-cli/issues
10
+ Keywords: anime,weeb,anime-download,anizm,anime-watch,anime-watching,anime-downloading,anime-cli,allanime,animecix,anime-indir,anime-izle,weeb-cli,anime-izleme,anime-indirme,weebanime,tranime
10
11
  Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Operating System :: OS Independent
12
13
  Classifier: Environment :: Console
@@ -4,16 +4,17 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "weeb-cli"
7
- version = "0.0.1"
7
+ version = "0.0.2"
8
8
  description = "Tarayıcı yok, reklam yok, dikkat dağıtıcı unsur yok. Sadece siz ve eşsiz bir anime izleme deneyimi."
9
9
  readme = "README.md"
10
10
  authors = [{ name = "ewgsta", email = "ewgst@proton.me" }]
11
- license = { text = "CC-BY-NC-ND-4.0" }
11
+ license = "CC-BY-NC-ND-4.0"
12
12
  classifiers = [
13
13
  "Programming Language :: Python :: 3",
14
14
  "Operating System :: OS Independent",
15
15
  "Environment :: Console",
16
16
  ]
17
+ keywords = ["anime", "weeb", "anime-download", "anizm", "anime-watch", "anime-watching", "anime-downloading", "anime-cli", "allanime", "animecix", "anime-indir", "anime-izle", "weeb-cli", "anime-izleme", "anime-indirme", "weebanime", "tranime"]
17
18
  requires-python = ">=3.8"
18
19
  dependencies = [
19
20
  "typer[all]",
@@ -22,6 +23,9 @@ dependencies = [
22
23
  "requests"
23
24
  ]
24
25
 
26
+ [tool.setuptools]
27
+ packages = ["weeb_cli"]
28
+
25
29
  [project.urls]
26
30
  Homepage = "https://github.com/ewgsta/weeb-cli"
27
31
  Repository = "https://github.com/ewgsta/weeb-cli"
@@ -0,0 +1 @@
1
+ __version__ = "0.0.2"
@@ -0,0 +1,43 @@
1
+ import json
2
+ import os
3
+ from pathlib import Path
4
+
5
+ APP_NAME = "weeb-cli"
6
+ CONFIG_DIR = Path.home() / f".{APP_NAME}"
7
+ CONFIG_FILE = CONFIG_DIR / "config.json"
8
+
9
+ DEFAULT_CONFIG = {
10
+ "language": None # None indicates setup hasn't run
11
+ }
12
+
13
+ class Config:
14
+ def __init__(self):
15
+ self._ensure_config_exists()
16
+ self.data = self._load()
17
+
18
+ def _ensure_config_exists(self):
19
+ if not CONFIG_DIR.exists():
20
+ CONFIG_DIR.mkdir(parents=True, exist_ok=True)
21
+ if not CONFIG_FILE.exists():
22
+ self._save(DEFAULT_CONFIG)
23
+
24
+ def _load(self):
25
+ try:
26
+ with open(CONFIG_FILE, "r", encoding="utf-8") as f:
27
+ return json.load(f)
28
+ except (json.JSONDecodeError, FileNotFoundError):
29
+ return DEFAULT_CONFIG.copy()
30
+
31
+ def _save(self, data):
32
+ with open(CONFIG_FILE, "w", encoding="utf-8") as f:
33
+ json.dump(data, f, indent=2, ensure_ascii=False)
34
+
35
+ def get(self, key, default=None):
36
+ return self.data.get(key, default)
37
+
38
+ def set(self, key, value):
39
+ self.data[key] = value
40
+ self._save(self.data)
41
+
42
+ # Singleton instance
43
+ config = Config()
@@ -0,0 +1,60 @@
1
+ import json
2
+ import os
3
+ from pathlib import Path
4
+ from weeb_cli.config import config
5
+
6
+ # Path to the locales directory
7
+ LOCALES_DIR = Path(__file__).parent / "locales"
8
+
9
+ class I18n:
10
+ def __init__(self):
11
+ self.language = config.get("language", "en") # Default to 'en' if not set, but setup should handle this
12
+ self.translations = {}
13
+ self.load_translations()
14
+
15
+ def set_language(self, language_code):
16
+ self.language = language_code
17
+ config.set("language", language_code)
18
+ self.load_translations()
19
+
20
+ def load_translations(self):
21
+ file_path = LOCALES_DIR / f"{self.language}.json"
22
+ if not file_path.exists():
23
+ # Fallback to English if file missing
24
+ file_path = LOCALES_DIR / "en.json"
25
+
26
+ try:
27
+ with open(file_path, "r", encoding="utf-8") as f:
28
+ self.translations = json.load(f)
29
+ except Exception as e:
30
+ print(f"Error loading translations: {e}")
31
+ self.translations = {}
32
+
33
+ def get(self, key_path, **kwargs):
34
+ """
35
+ Get a translation string by dot-separated path.
36
+ Example: i18n.get("menu.title")
37
+ Supports formatting: i18n.get("hello.response", name="User")
38
+ """
39
+ keys = key_path.split(".")
40
+ value = self.translations
41
+
42
+ for key in keys:
43
+ if isinstance(value, dict):
44
+ value = value.get(key)
45
+ else:
46
+ return key_path # Key not found
47
+
48
+ if value is None:
49
+ return key_path
50
+
51
+ if isinstance(value, str):
52
+ try:
53
+ return value.format(**kwargs)
54
+ except KeyError:
55
+ return value
56
+
57
+ return value
58
+
59
+ # Singleton instance
60
+ i18n = I18n()
@@ -0,0 +1,46 @@
1
+ import typer
2
+ import questionary
3
+ from weeb_cli.ui.menu import show_main_menu
4
+ from weeb_cli.commands.hello import say_hello
5
+ from weeb_cli.commands.settings import open_settings
6
+ from weeb_cli.config import config
7
+ from weeb_cli.i18n import i18n
8
+
9
+ app = typer.Typer(add_completion=False)
10
+
11
+ def run_setup():
12
+ """First run setup to select language."""
13
+ langs = {
14
+ "Türkçe": "tr",
15
+ "English": "en"
16
+ }
17
+
18
+ selected = questionary.select(
19
+ "Select Language / Dil Seçiniz",
20
+ choices=list(langs.keys()),
21
+ use_indicator=True
22
+ ).ask()
23
+
24
+ if selected:
25
+ i18n.set_language(langs[selected])
26
+
27
+ @app.command()
28
+ def start():
29
+ # If language is not set (first run), run setup
30
+ if not config.get("language"):
31
+ run_setup()
32
+
33
+ # Define actions mapping: Key (for i18n lookup) -> Function
34
+ actions = {
35
+ "hello": say_hello,
36
+ "settings": open_settings
37
+ }
38
+ show_main_menu(actions)
39
+
40
+ @app.callback(invoke_without_command=True)
41
+ def main(ctx: typer.Context):
42
+ if ctx.invoked_subcommand is None:
43
+ start()
44
+
45
+ if __name__ == "__main__":
46
+ app()
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weeb-cli
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Tarayıcı yok, reklam yok, dikkat dağıtıcı unsur yok. Sadece siz ve eşsiz bir anime izleme deneyimi.
5
5
  Author-email: ewgsta <ewgst@proton.me>
6
- License: CC-BY-NC-ND-4.0
6
+ License-Expression: CC-BY-NC-ND-4.0
7
7
  Project-URL: Homepage, https://github.com/ewgsta/weeb-cli
8
8
  Project-URL: Repository, https://github.com/ewgsta/weeb-cli
9
9
  Project-URL: Issues, https://github.com/ewgsta/weeb-cli/issues
10
+ Keywords: anime,weeb,anime-download,anizm,anime-watch,anime-watching,anime-downloading,anime-cli,allanime,animecix,anime-indir,anime-izle,weeb-cli,anime-izleme,anime-indirme,weebanime,tranime
10
11
  Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Operating System :: OS Independent
12
13
  Classifier: Environment :: Console
@@ -1,13 +1,12 @@
1
1
  pyproject.toml
2
2
  weeb_cli/__init__.py
3
3
  weeb_cli/__main__.py
4
+ weeb_cli/config.py
5
+ weeb_cli/i18n.py
4
6
  weeb_cli/main.py
5
7
  weeb_cli.egg-info/PKG-INFO
6
8
  weeb_cli.egg-info/SOURCES.txt
7
9
  weeb_cli.egg-info/dependency_links.txt
8
10
  weeb_cli.egg-info/entry_points.txt
9
11
  weeb_cli.egg-info/requires.txt
10
- weeb_cli.egg-info/top_level.txt
11
- weeb_cli/commands/hello.py
12
- weeb_cli/ui/header.py
13
- weeb_cli/ui/menu.py
12
+ weeb_cli.egg-info/top_level.txt
@@ -1 +0,0 @@
1
- __version__ = "0.0.1"
@@ -1,19 +0,0 @@
1
- import time
2
- from rich.console import Console
3
- import questionary
4
-
5
- console = Console()
6
-
7
- def say_hello():
8
- with console.status("[bold green]İşlem yapılıyor...") as status:
9
- time.sleep(1)
10
- console.print("[green]Selam Weeb![/green] 🚀")
11
-
12
- console.print("[blue]Bu Python ile yazılmış örnek bir komut çıktısıdır.[/blue]")
13
- console.print()
14
-
15
- questionary.text(
16
- "Devam etmek için Enter'a basın...",
17
- qmark="⌨️",
18
- style=questionary.Style([('qmark', 'fg:cyan')])
19
- ).ask()
@@ -1,22 +0,0 @@
1
- import typer
2
- from .ui.menu import show_main_menu
3
- from .commands.hello import say_hello
4
- from .ui.header import show_header
5
-
6
- app = typer.Typer(add_completion=False)
7
-
8
- @app.command()
9
- def start():
10
- actions = {
11
- "Selam Ver": say_hello,
12
- "Uygulama Hakkında": lambda: print("Weeb CLI v0.0.1")
13
- }
14
- show_main_menu(actions)
15
-
16
- @app.callback(invoke_without_command=True)
17
- def main(ctx: typer.Context):
18
- if ctx.invoked_subcommand is None:
19
- start()
20
-
21
- if __name__ == "__main__":
22
- app()
@@ -1,25 +0,0 @@
1
- from rich import print
2
- from rich.panel import Panel
3
- from rich.text import Text
4
- from rich.console import Console
5
- import pyfiglet
6
-
7
- console = Console()
8
-
9
- def show_header():
10
- console.clear()
11
-
12
- f = pyfiglet.Figlet(font='big')
13
- title_text = f.renderText('Weeb CLI')
14
-
15
- panel = Panel(
16
- Text(title_text, justify="center", style="bold cyan"),
17
- subtitle="v0.0.1",
18
- subtitle_align="right",
19
- border_style="blue",
20
- padding=(1, 2)
21
- )
22
-
23
- console.print(panel)
24
- console.print("[dim italic]> Sadece sen ve anime.[/dim italic]", justify="center")
25
- print()
@@ -1,39 +0,0 @@
1
- import questionary
2
- from rich.console import Console
3
- import sys
4
- from .header import show_header
5
-
6
- console = Console()
7
-
8
- def show_main_menu(actions):
9
- console.clear()
10
- show_header()
11
-
12
- choices = list(actions.keys()) + ["Çıkış Yap"]
13
-
14
- try:
15
- answer = questionary.select(
16
- "Bir işlem seçin:",
17
- choices=choices,
18
- use_indicator=True,
19
- style=questionary.Style([
20
- ('pointer', 'fg:cyan bold'),
21
- ('highlighted', 'fg:cyan'),
22
- ('selected', 'fg:cyan bold'),
23
- ])
24
- ).ask()
25
-
26
- if answer == "Çıkış Yap" or answer is None:
27
- console.print("[yellow]👋 Görüşmek üzere...[/yellow]")
28
- sys.exit(0)
29
-
30
- action = actions.get(answer)
31
- if action:
32
- action()
33
-
34
- # Loop back to menu
35
- show_main_menu(actions)
36
-
37
- except KeyboardInterrupt:
38
- console.print("\n[yellow]👋 Görüşmek üzere...[/yellow]")
39
- sys.exit(0)
File without changes
File without changes