Skip to content

Commit 3448f3b

Browse files
committed
fix end of file
1 parent a3ae7dd commit 3448f3b

Some content is hidden

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

43 files changed

+664
-679
lines changed

.github/workflows/merge_check.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,31 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v4
12-
1312
- name: Set up Python
1413
uses: actions/setup-python@v5
1514
with:
1615
python-version: '3.10'
17-
1816
- name: Install CLI dependencies
1917
run: |
2018
python -m pip install --upgrade pip
2119
pip install -e extensions/cli/
22-
2320
- name: Install TUI dependencies
2421
run: |
2522
pip install -e extensions/tui/
26-
2723
- name: Run CLI tests
2824
run: |
2925
cd extensions/cli
3026
python -m pytest tests/ -v
31-
3227
- name: Run TUI tests
3328
run: |
3429
cd extensions/tui
3530
python -m pytest tests/ -v
36-
3731
- name: Install scripts dependencies
3832
run: |
3933
python -m pip install PyYAML jsonschema
40-
4134
- name: Run scripts tests
4235
run: |
4336
python -m pytest scripts/tests/ -v
44-
4537
build:
4638
name: Build Frontend
4739
runs-on: ubuntu-latest

.github/workflows/tests.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,63 @@
11
name: Tests
2-
32
on:
43
push:
54
branches: [main]
65
pull_request:
76
branches: [main]
8-
97
jobs:
108
test-cli:
119
name: Test CLI Extension
1210
runs-on: ubuntu-latest
1311
steps:
1412
- name: Checkout
1513
uses: actions/checkout@v4
16-
1714
- name: Set up Python
1815
uses: actions/setup-python@v5
1916
with:
2017
python-version: '3.10'
21-
2218
- name: Install CLI dependencies
2319
run: |
2420
python -m pip install --upgrade pip
25-
pip install -e extensions/cli/
26-
21+
pip install -e "extensions/cli/[dev]"
2722
- name: Run CLI tests
2823
run: |
2924
cd extensions/cli
3025
python -m pytest tests/ -v
31-
3226
test-tui:
3327
name: Test TUI Extension
3428
runs-on: ubuntu-latest
3529
steps:
3630
- name: Checkout
3731
uses: actions/checkout@v4
38-
3932
- name: Set up Python
4033
uses: actions/setup-python@v5
4134
with:
4235
python-version: '3.10'
43-
4436
- name: Install CLI dependencies (TUI depends on CLI)
4537
run: |
4638
python -m pip install --upgrade pip
4739
pip install -e extensions/cli/
48-
4940
- name: Install TUI dependencies
5041
run: |
51-
pip install -e extensions/tui/
52-
42+
pip install -e "extensions/tui/[dev]"
5343
- name: Run TUI tests
5444
run: |
5545
cd extensions/tui
5646
python -m pytest tests/ -v
57-
5847
test-python-scripts:
5948
name: Test Python Scripts
6049
runs-on: ubuntu-latest
6150
steps:
6251
- name: Checkout
6352
uses: actions/checkout@v4
64-
6553
- name: Set up Python
6654
uses: actions/setup-python@v5
6755
with:
6856
python-version: '3.10'
69-
7057
- name: Install dependencies
7158
run: |
7259
python -m pip install --upgrade pip
7360
python -m pip install PyYAML jsonschema
74-
7561
- name: Run scripts tests
7662
run: |
7763
python -m pytest scripts/tests/ -v

extensions/cli/ccfddl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
"is_valid_sub",
3939
"CacheManager",
4040
"get_default_cache",
41-
]
41+
]

extensions/cli/ccfddl/__main__.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def process_conference_deadlines(
9292
) -> list[dict]:
9393
"""Process conferences and extract upcoming deadlines."""
9494
results = []
95-
95+
9696
for conf in conferences:
9797
base_info = {
9898
"title": conf.title,
@@ -101,15 +101,15 @@ def process_conference_deadlines(
101101
"rank": conf.rank.ccf,
102102
"dblp": conf.dblp,
103103
}
104-
104+
105105
for conf_year in conf.confs:
106106
time_obj = None
107-
107+
108108
for timeline in conf_year.timeline:
109109
deadline_str = timeline.deadline
110110
if not deadline_str or deadline_str == "TBD":
111111
continue
112-
112+
113113
try:
114114
cur_d = parse_datetime_with_tz(deadline_str, conf_year.timezone)
115115
if cur_d < now:
@@ -118,7 +118,7 @@ def process_conference_deadlines(
118118
time_obj = cur_d
119119
except ValueError:
120120
continue
121-
121+
122122
if time_obj is not None and time_obj > now:
123123
category = get_category_by_sub(conf.sub)
124124
result = {
@@ -135,7 +135,7 @@ def process_conference_deadlines(
135135
"subname_en": category.name_en if category else conf.sub,
136136
}
137137
results.append(result)
138-
138+
139139
results.sort(key=lambda x: x["deadline"])
140140
return results
141141

@@ -148,11 +148,11 @@ def filter_results(
148148
) -> list[dict]:
149149
"""Apply filters to results."""
150150
filtered = []
151-
151+
152152
conf_filter_lower = [f.lower() for f in conf_filter] if conf_filter else None
153153
sub_filter_lower = [f.lower() for f in sub_filter] if sub_filter else None
154154
rank_filter_lower = [f.lower() for f in rank_filter] if rank_filter else None
155-
155+
156156
for item in results:
157157
if conf_filter_lower:
158158
id_alpha = extract_alpha_id(item["id"])
@@ -164,15 +164,15 @@ def filter_results(
164164
if rank_filter_lower and item["rank"].lower() not in rank_filter_lower:
165165
continue
166166
filtered.append(item)
167-
167+
168168
return filtered
169169

170170

171171
def format_colored_duration(ddl_time: datetime, now: datetime) -> str:
172172
"""Format duration with color coding."""
173173
duration_str = format_duration(ddl_time, now)
174174
days = (ddl_time - now).days
175-
175+
176176
if days < 1:
177177
return colored(duration_str, "red")
178178
elif days < 30:
@@ -186,7 +186,7 @@ def format_colored_duration(ddl_time: datetime, now: datetime) -> str:
186186
def output_table(results: list[dict], now: datetime) -> None:
187187
"""Output results as a formatted table."""
188188
table = [["Title", "Sub", "Rank", "DDL", "Link"]]
189-
189+
190190
for item in results:
191191
table.append([
192192
f"{item['title']} {item['year']}",
@@ -195,7 +195,7 @@ def output_table(results: list[dict], now: datetime) -> None:
195195
format_colored_duration(item["deadline"], now),
196196
item["link"],
197197
])
198-
198+
199199
print(tabulate(table, headers="firstrow", tablefmt="fancy_grid"))
200200

201201

@@ -234,27 +234,27 @@ def list_categories() -> None:
234234
def main() -> None:
235235
"""Main entry point."""
236236
args = parse_args()
237-
237+
238238
if args.list_categories:
239239
list_categories()
240240
return
241-
241+
242242
now = datetime.now(tz=timezone.utc)
243243
conferences = fetch_conferences(args.url)
244244
results = process_conference_deadlines(conferences, now)
245-
245+
246246
filtered = filter_results(
247247
results,
248248
args.conf,
249249
args.sub,
250250
args.rank,
251251
)
252-
252+
253253
if args.json:
254254
output_json(filtered)
255255
else:
256256
output_table(filtered, now)
257257

258258

259259
if __name__ == "__main__":
260-
main()
260+
main()

extensions/cli/ccfddl/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ def is_cache_valid(self, key: str) -> bool:
124124

125125
def get_default_cache() -> CacheManager:
126126
"""Get default cache manager instance."""
127-
return CacheManager()
127+
return CacheManager()

extensions/cli/ccfddl/convert_to_ical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ def convert_to_ical(
182182
),
183183
)
184184
element_mapping(index.keys(), f, thread_pool_size=8)
185-
print("转换完成")
185+
print("转换完成")

extensions/cli/ccfddl/convert_to_rss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ def convert_to_rss(
162162
),
163163
)
164164
element_mapping(index.keys(), f, thread_pool_size=8)
165-
print("RSS feed generation complete")
165+
print("RSS feed generation complete")

extensions/cli/ccfddl/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,4 @@ def from_dict(cls, data: dict[str, Any]) -> "ConfAccRate":
218218
return cls(
219219
title=data.get("title", ""),
220220
accept_rates=[AccYear.from_dict(r) for r in rates_data],
221-
)
221+
)

extensions/cli/ccfddl/utils.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
def load_mapping(path: str = "conference/types.yml") -> dict[str, str]:
1616
"""Load sub-category name mapping from YAML file.
17-
17+
1818
Args:
1919
path: Path to the types.yml file
20-
20+
2121
Returns:
2222
Dictionary mapping sub codes to Chinese names
2323
"""
@@ -31,18 +31,18 @@ def load_mapping(path: str = "conference/types.yml") -> dict[str, str]:
3131

3232
def get_timezone(tz_str: str) -> timezone:
3333
"""Convert timezone string to datetime.timezone object.
34-
34+
3535
Supported formats:
3636
- 'AoE' (Anywhere on Earth, UTC-12)
3737
- 'UTC' (UTC+0)
3838
- 'UTC+8', 'UTC-5' (UTC with offset)
39-
39+
4040
Args:
4141
tz_str: Timezone string
42-
42+
4343
Returns:
4444
A timezone object
45-
45+
4646
Raises:
4747
ValueError: If the timezone format is invalid
4848
"""
@@ -62,15 +62,15 @@ def parse_datetime_with_tz(
6262
dt_str: str, tz_str: str, format_str: str = "%Y-%m-%d %H:%M:%S"
6363
) -> datetime:
6464
"""Parse datetime string with timezone.
65-
65+
6666
Args:
6767
dt_str: Datetime string (e.g., '2025-01-15 23:59:59')
6868
tz_str: Timezone string (e.g., 'UTC-8', 'AoE')
6969
format_str: Datetime format string
70-
70+
7171
Returns:
7272
Timezone-aware datetime object
73-
73+
7474
Raises:
7575
ValueError: If datetime or timezone format is invalid
7676
"""
@@ -81,11 +81,11 @@ def parse_datetime_with_tz(
8181

8282
def format_duration(ddl_time: datetime, now: datetime) -> str:
8383
"""Format the remaining duration until deadline.
84-
84+
8585
Args:
8686
ddl_time: Deadline datetime (timezone-aware)
8787
now: Current datetime (timezone-aware)
88-
88+
8989
Returns:
9090
Formatted duration string
9191
"""
@@ -109,11 +109,11 @@ def format_duration(ddl_time: datetime, now: datetime) -> str:
109109

110110
def reverse_index(file_paths: list[str], subs: list[str]) -> dict[str, list[str]]:
111111
"""Build reverse index of conferences by category and rank.
112-
112+
113113
Args:
114114
file_paths: List of YAML file paths to process
115115
subs: List of valid sub codes
116-
116+
117117
Returns:
118118
Dictionary mapping category/rank keys to file paths
119119
"""
@@ -148,4 +148,4 @@ def reverse_index(file_paths: list[str], subs: list[str]) -> dict[str, list[str]
148148

149149
def _add_index_entry(index: dict[str, set[str]], key: str, file_path: str) -> None:
150150
"""Add entry to reverse index."""
151-
index[key].add(file_path)
151+
index[key].add(file_path)

extensions/cli/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ disallow_untyped_defs = true
4848

4949
[[tool.mypy.overrides]]
5050
module = ["icalendar.*", "xlin.*", "termcolor.*"]
51-
ignore_missing_imports = true
51+
ignore_missing_imports = true

0 commit comments

Comments
 (0)