Repository navigation
Expand file tree
/
Copy pathCalender.py
More file actions
122 lines (107 loc) · 3.2 KB
/
Copy pathCalender.py
File metadata and controls
122 lines (107 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
"""
EventCalendarGenerator - Backward Compatibility Layer
This file re-exports all public symbols from the refactored package
to maintain backward compatibility with existing imports.
DEPRECATED: Import from eventcalendar package directly instead.
Example: from eventcalendar.ui import NLCalendarCreator
"""
import sys
import os
import warnings
# Add src to path for package imports
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
# Emit deprecation warning on import (only once)
warnings.warn(
"Importing from Calender.py is deprecated. "
"Use 'from eventcalendar import ...' instead.",
DeprecationWarning,
stacklevel=2
)
# Re-export datetime for test monkeypatching compatibility
from datetime import datetime, timedelta
# Re-export UI components
from eventcalendar.ui.main_window import NLCalendarCreator
from eventcalendar.ui.widgets.api_key_dialog import APIKeySetupDialog
from eventcalendar.ui.widgets.image_area import ImageAttachmentArea, ImageAttachmentPayload
# Re-export theme system
from eventcalendar.ui.theme.manager import ThemeManager, set_theme, toggle_theme
from eventcalendar.ui.theme.colors import get_color, COLORS
from eventcalendar.ui.theme.palettes import LIGHT_PALETTE, DARK_PALETTE
from eventcalendar.ui.theme.scales import TYPOGRAPHY_SCALE, SPACING_SCALE, BORDER_RADIUS
from eventcalendar.ui.styles.base import px
# Re-export error handling
from eventcalendar.ui.error_messages import get_user_friendly_error
# Re-export storage functions
from eventcalendar.storage.key_manager import (
load_api_key,
save_api_key,
get_api_key_source,
migrate_legacy_key,
check_and_warn_legacy_storage,
)
from eventcalendar.storage.env_storage import (
get_user_config_dir,
get_env_file_path,
get_legacy_env_path,
get_executable_dir_env_path,
)
# Re-export ICS builder
from eventcalendar.core.ics_builder import combine_ics_strings
# Re-export utilities
from eventcalendar.utils.paths import get_resource_path
# Re-export constants
from eventcalendar.config.constants import (
KEYRING_SERVICE_NAME,
KEYRING_ACCOUNT_NAME,
PREFERRED_ENV_VAR,
PRIMARY_ENV_VAR,
SUPPORTED_IMAGE_EXTENSIONS,
)
__all__ = [
# datetime for monkeypatching
'datetime',
'timedelta',
# UI
'NLCalendarCreator',
'APIKeySetupDialog',
'ImageAttachmentArea',
'ImageAttachmentPayload',
# Theme
'ThemeManager',
'set_theme',
'toggle_theme',
'get_color',
'COLORS',
'LIGHT_PALETTE',
'DARK_PALETTE',
'TYPOGRAPHY_SCALE',
'SPACING_SCALE',
'BORDER_RADIUS',
'px',
# Error handling
'get_user_friendly_error',
# Storage
'load_api_key',
'save_api_key',
'get_api_key_source',
'migrate_legacy_key',
'check_and_warn_legacy_storage',
'get_user_config_dir',
'get_env_file_path',
'get_legacy_env_path',
'get_executable_dir_env_path',
# ICS
'combine_ics_strings',
# Utils
'get_resource_path',
# Constants
'KEYRING_SERVICE_NAME',
'KEYRING_ACCOUNT_NAME',
'PREFERRED_ENV_VAR',
'PRIMARY_ENV_VAR',
'SUPPORTED_IMAGE_EXTENSIONS',
]
# Entry point for backward compatibility
if __name__ == '__main__':
from eventcalendar.__main__ import main
main()