Skip to content

Commit ca50794

Browse files
committed
- Cladue Sonnet 4.5
Critical Bugs Fixed: Parameter Shadowing Bug in team.py:159: Fixed toTimeOfDay parameter being reassigned, which caused variable shadowing Bare Exception Handling: Replaced bare except: clauses with proper Exception handling in team.py:245 and team_member.py Performance Optimizations: String Concatenation: Replaced inefficient string concatenation in loops with list comprehension + join() in: Comparison Operators: Simplified comparison operators in named.py using @functools.total_ordering decorator, reducing code duplication Code Quality Improvements: Import Statements: Converted all absolute imports (from PyShift.workschedule.*) to relative imports (from .*) in all 13 Python files for better package portability Fixed bare [] type hints to proper List[Type] annotations Added Optional[Type] for nullable fields Improved return type hints throughout F-strings: Modernized string formatting using f-strings instead of % formatting for better readability and performance
1 parent ce4bd66 commit ca50794

29 files changed

Lines changed: 170 additions & 149 deletions

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.pyc
6+
7+
# Distribution / packaging
8+
.Python
9+
build/
10+
develop-eggs/
11+
dist/
12+
downloads/
13+
eggs/
14+
.eggs/
15+
lib/
16+
lib64/
17+
parts/
18+
sdist/
19+
var/
20+
wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
MANIFEST
25+
26+
# Virtual environments
27+
.venv/
28+
venv/
29+
ENV/
30+
env/
31+
32+
# IDE
33+
.vscode/
34+
.idea/
35+
*.swp
36+
*.swo
37+
*~
38+
.project
39+
.pydevproject
40+
.settings/
41+
42+
# OS
43+
.DS_Store
44+
Thumbs.db

PyShift/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""PyShift - A work schedule library for shifts."""
2+
3+
# Make submodules accessible
4+
from . import workschedule
5+
from . import test
6+
7+
__version__ = "1.1.2"
8+
__all__ = ['workschedule', 'test']

PyShift/test/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Test package initialization

PyShift/workschedule/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""PyShift workschedule package."""
2+
3+
__version__ = "1.1.2"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from PyShift.workschedule.time_period import TimePeriod
21
from datetime import timedelta, time
2+
from .time_period import TimePeriod
33

44
##
55
# Class DayOff represents a scheduled non-working period

workschedule/locales/en_US/LC_MESSAGES/schedule.mo renamed to PyShift/workschedule/locales/en_US/LC_MESSAGES/schedule.mo

File renamed without changes.

0 commit comments

Comments
 (0)