Skip to content

Commit 7b09e39

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1ac9184 commit 7b09e39

File tree

168 files changed

+4807
-3837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+4807
-3837
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
.cache/
3535
build/
3636
test/
37-
.venv/
37+
.venv/

docs/enhanced_sequence_system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ sequence.push_back({{"task_id", focusId}});
354354

355355
// 5. Imaging
356356
for (const auto& filter : {"Ha", "OIII", "SII"}) {
357-
auto imagingTask = templates->createTask("imaging",
357+
auto imagingTask = templates->createTask("imaging",
358358
std::string("imaging_") + filter, {
359359
{"target", "M31"},
360360
{"filter", filter},

python/tools/auto_updater/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ updater = AutoUpdater(config)
4343
# Check and install updates if available
4444
if updater.check_for_updates():
4545
print("Update found!")
46-
46+
4747
# Complete update process - download, verify, backup, and install
4848
if updater.update():
4949
print(f"Successfully updated to version {updater.update_info['version']}")
@@ -121,7 +121,7 @@ from auto_updater import AutoUpdater, UpdateStatus
121121
def progress_callback(status, progress, message):
122122
"""
123123
Handle progress updates.
124-
124+
125125
Args:
126126
status (UpdateStatus): Current update status
127127
progress (float): Progress value (0.0 to 1.0)
@@ -150,16 +150,16 @@ updater = AutoUpdater(config)
150150
if updater.check_for_updates():
151151
# Download the update package
152152
download_path = updater.download_update()
153-
153+
154154
# Verify the downloaded package
155155
if updater.verify_update(download_path):
156156
# Backup current installation
157157
backup_dir = updater.backup_current_installation()
158-
158+
159159
try:
160160
# Extract the update package
161161
extract_dir = updater.extract_update(download_path)
162-
162+
163163
# Install the update
164164
if updater.install_update(extract_dir):
165165
print("Update installed successfully!")
@@ -183,7 +183,7 @@ updater = AutoUpdaterSync(config)
183183
if updater.check_for_updates():
184184
# Get path to downloaded file as string
185185
download_path = updater.download_update()
186-
186+
187187
# Use regular strings for paths
188188
extract_dir = updater.extract_update(download_path)
189189
updater.install_update(extract_dir)
@@ -255,4 +255,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
255255
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
256256
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
257257
4. Push to the branch (`git push origin feature/amazing-feature`)
258-
5. Open a Pull Request
258+
5. Open a Pull Request

python/tools/auto_updater/__init__.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@
1111
"""
1212

1313
from .types import (
14-
UpdateStatus, UpdaterError, NetworkError, VerificationError, InstallationError,
15-
UpdaterConfig, PathLike, HashType
14+
UpdateStatus,
15+
UpdaterError,
16+
NetworkError,
17+
VerificationError,
18+
InstallationError,
19+
UpdaterConfig,
20+
PathLike,
21+
HashType,
1622
)
1723
from .core import AutoUpdater
1824
from .sync import AutoUpdaterSync, create_updater, run_updater
@@ -25,28 +31,23 @@
2531
# Core classes
2632
"AutoUpdater",
2733
"AutoUpdaterSync",
28-
2934
# Types
3035
"UpdaterConfig",
3136
"UpdateStatus",
32-
3337
# Exceptions
3438
"UpdaterError",
3539
"NetworkError",
3640
"VerificationError",
3741
"InstallationError",
38-
3942
# Utility functions
4043
"compare_versions",
4144
"parse_version",
4245
"calculate_file_hash",
4346
"create_updater",
4447
"run_updater",
45-
4648
# Type definitions
4749
"PathLike",
4850
"HashType",
49-
5051
# Logger
5152
"logger",
5253
]
@@ -55,4 +56,5 @@
5556
if __name__ == "__main__":
5657
import sys
5758
from .cli import main
59+
5860
sys.exit(main())

python/tools/auto_updater/cli.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .core import AutoUpdater
88
from .types import UpdaterError
99

10+
1011
def main() -> int:
1112
"""
1213
The main entry point for the command-line interface.
@@ -22,57 +23,56 @@ def main() -> int:
2223
"--config",
2324
type=str,
2425
required=True,
25-
help="Path to the configuration file (JSON)"
26+
help="Path to the configuration file (JSON)",
2627
)
2728

2829
parser.add_argument(
2930
"--check-only",
3031
action="store_true",
31-
help="Only check for updates, don't download or install"
32+
help="Only check for updates, don't download or install",
3233
)
3334

3435
parser.add_argument(
3536
"--download-only",
3637
action="store_true",
37-
help="Download but don't install updates"
38+
help="Download but don't install updates",
3839
)
3940

4041
parser.add_argument(
4142
"--verify-only",
4243
action="store_true",
43-
help="Download and verify but don't install updates"
44+
help="Download and verify but don't install updates",
4445
)
4546

4647
parser.add_argument(
47-
"--rollback",
48-
type=str,
49-
help="Path to backup directory to rollback to"
48+
"--rollback", type=str, help="Path to backup directory to rollback to"
5049
)
5150

5251
parser.add_argument(
5352
"--verbose",
5453
"-v",
5554
action="count",
5655
default=0,
57-
help="Increase verbosity (can be used multiple times)"
56+
help="Increase verbosity (can be used multiple times)",
5857
)
5958

6059
args = parser.parse_args()
6160

6261
# Configure logger based on verbosity level
6362
if args.verbose > 0:
6463
from .logger import logger
64+
6565
logger.remove()
6666
logger.add(
6767
sink=sys.stderr,
6868
level="DEBUG" if args.verbose > 1 else "INFO",
69-
format="<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>"
69+
format="<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
7070
)
7171

7272
updater = None # Ensure updater is always defined
7373
try:
7474
# Load configuration
75-
with open(args.config, 'r') as f:
75+
with open(args.config, "r") as f:
7676
config = json.load(f)
7777

7878
# Create updater
@@ -97,15 +97,17 @@ def main() -> int:
9797
print(f"Update available: {updater.update_info['version']}")
9898
else:
9999
print(
100-
f"No updates available (current version: {config['current_version']})")
100+
f"No updates available (current version: {config['current_version']})"
101+
)
101102
return 0
102103

103104
elif args.download_only:
104105
# Check and download only
105106
update_available = updater.check_for_updates()
106107
if not update_available:
107108
print(
108-
f"No updates available (current version: {config['current_version']})")
109+
f"No updates available (current version: {config['current_version']})"
110+
)
109111
return 0
110112

111113
download_path = updater.download_update()
@@ -117,7 +119,8 @@ def main() -> int:
117119
update_available = updater.check_for_updates()
118120
if not update_available:
119121
print(
120-
f"No updates available (current version: {config['current_version']})")
122+
f"No updates available (current version: {config['current_version']})"
123+
)
121124
return 0
122125

123126
download_path = updater.download_update()
@@ -134,7 +137,8 @@ def main() -> int:
134137
success = updater.update()
135138
if success and updater.update_info:
136139
print(
137-
f"Update to version {updater.update_info['version']} completed successfully")
140+
f"Update to version {updater.update_info['version']} completed successfully"
141+
)
138142
return 0
139143
else:
140144
print("No updates installed")
@@ -152,8 +156,9 @@ def main() -> int:
152156
except Exception as e:
153157
print(f"Unexpected error: {e}")
154158
import traceback
159+
155160
traceback.print_exc()
156161
return 1
157162
finally:
158163
if updater is not None:
159-
updater.cleanup()
164+
updater.cleanup()

0 commit comments

Comments
 (0)