Skip to content

Commit

Permalink
重构代码:更新头文件引用,添加屏幕亮度设置功能,修复拼写错误,优化命令执行接口,添加智能曝光类
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroAir committed Nov 1, 2024
1 parent e205e6a commit 1e637c0
Show file tree
Hide file tree
Showing 30 changed files with 1,655 additions and 792 deletions.
20 changes: 10 additions & 10 deletions scripts/vcpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def install(self, package_name):
package_name, package.version)
except Exception as e:
logger.error("Error installing %s: %s", package_name, str(e))
raise InstallationError(f"Failed to install {
package_name}: {str(e)}") from e
raise InstallationError(
f"Failed to install {package_name}: {str(e)}") from e

def _install_dependencies(self, dependencies):
"""
Expand Down Expand Up @@ -253,13 +253,13 @@ def update(self):
print(f"Checking for updates: {package}...")
new_info = self._fetch_package_info(package)
if new_info.version > installed[package]["version"]:
print(f"Updating {package} from {
installed[package]['version']} to {new_info.version}")
print(
f"Updating {package} from {installed[package]['version']} to {new_info.version}")
self.remove(package)
self.install(package)
else:
print(f"{package} is already up to date (version {
installed[package]['version']}).")
print(
f"{package} is already up to date (version {installed[package]['version']}).")

print("All packages are up to date.")
logger.info("All packages updated")
Expand All @@ -285,8 +285,8 @@ def search(self, query):
"description": f"Tools for working with {query}", "version": "2.1.0"},
]
for result in results:
print(f" {result['name']} (v{result['version']}): {
result['description']}")
print(
f" {result['name']} (v{result['version']}): {result['description']}")
except Exception as e:
logger.error("Error searching for packages: %s", str(e))
print(f"Error searching for packages: {str(e)}")
Expand Down Expand Up @@ -318,8 +318,8 @@ def info(self, package_name):
print("Status: Not installed")
print(f"Dependencies: {', '.join(package.dependencies)}")
except PackageNotFoundError:
print(f"No information found for package '{
package_name}'.")
print(
f"No information found for package '{package_name}'.")
except Exception as e:
logger.error("Error retrieving package info: %s", str(e))
print(f"Error retrieving package info: {str(e)}")
Expand Down
Loading

0 comments on commit 1e637c0

Please sign in to comment.