Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.11 changes #148

Merged
merged 3 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ruyi"
version = "0.11.0-alpha.20240512"
version = "0.11.0-alpha.20240527"
description = "Package manager for RuyiSDK"
keywords = ["ruyi", "ruyisdk"]
# license = { file = "LICENSE-Apache.txt" }
Expand Down
3 changes: 2 additions & 1 deletion ruyi/cli/user_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def ask_for_yesno_confirmation(prompt: str, default: bool = False) -> bool:

while True:
try:
user_input = input(f"{prompt} {choices_help} ")
log.stdout(f"{prompt} {choices_help} ", end='')
user_input = input()
except EOFError:
yesno = "YES" if default else "NO"
log.W(f"EOF while reading user input, assuming the default choice {yesno}")
Expand Down
2 changes: 1 addition & 1 deletion ruyi/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def global_blob_install_root(self, slug: str) -> str:

def lookup_binary_install_dir(self, host: str, slug: str) -> PathLike[Any] | None:
host_path = get_host_path_fragment_for_binary_install_dir(host)
for data_dir in self._dirs.data_dirs:
for data_dir in self._dirs.app_data_dirs:
p = data_dir / "binaries" / host_path / slug
if p.exists():
return p
Expand Down
6 changes: 4 additions & 2 deletions ruyi/utils/xdg_basedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ def app_state(self) -> pathlib.Path:
def app_config_dirs(self) -> Iterable[pathlib.Path]:
# from highest precedence to lowest
yield self.app_config
yield from self.config_dirs
for p in self.config_dirs:
yield p / self.app_name

@property
def app_data_dirs(self) -> Iterable[pathlib.Path]:
# from highest precedence to lowest
yield self.app_data
yield from self.data_dirs
for p in self.data_dirs:
yield p / self.app_name