Skip to content

Commit 1289944

Browse files
authored
Merge branch 'master' into fix-eventcolumn
2 parents ec164f5 + e80134f commit 1289944

File tree

15 files changed

+27
-32
lines changed

15 files changed

+27
-32
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
args: [--markdown-linebreak-ext=md]
@@ -9,7 +9,7 @@ repos:
99
- id: check-added-large-files
1010
- id: debug-statements
1111
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v1.17.0
12+
rev: v1.17.1
1313
hooks:
1414
- id: mypy
1515
additional_dependencies:
@@ -19,7 +19,7 @@ repos:
1919
- types-setuptools
2020
- types-python-dateutil
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: 'v0.12.5'
22+
rev: 'v0.12.10'
2323
hooks:
2424
- id: ruff
2525
args: ["--fix"]

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ unreleased
1313

1414
* CHANGE the ``pkg_resources`` library is no longer required.
1515
* FIX color of eventcolumn when editing events in ikhal
16+
* FIX the location of caching database to ``$XDG_CACHE_HOME``
1617

1718
0.13.0
1819
======

doc/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# noqa: E265
21
#
32
# khal documentation build configuration file, created by
43
# sphinx-quickstart on Fri Jul 4 00:00:47 2014.

khal/icalendar.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,7 @@ def sanitize_rrule(vevent):
469469

470470
def invalid_timezone(prop):
471471
"""check if an icalendar property has a timezone attached we don't understand"""
472-
if hasattr(prop.dt, 'tzinfo') and prop.dt.tzinfo is None and 'TZID' in prop.params:
473-
return True
474-
else:
475-
return False
472+
return bool(hasattr(prop.dt, 'tzinfo') and prop.dt.tzinfo is None and 'TZID' in prop.params)
476473

477474

478475
def _get_all_properties(vevent, prop):

khal/khalendar/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def at_once(self) -> Iterator['SQLiteDb']:
9797
self._at_once = True
9898
try:
9999
yield self
100-
except: # noqa
100+
except:
101101
raise
102102
else:
103103
self.conn.commit()

khal/khalendar/khalendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def _update_vevent(self, href: str, calendar: str) -> bool:
403403
if not isinstance(e, (UpdateFailed, UnsupportedFeatureError, NonUniqueUID)):
404404
logger.exception('Unknown exception happened.')
405405
logger.warning(
406-
f'Skipping {calendar}/{href}: {str(e)}\n'
406+
f'Skipping {calendar}/{href}: {e!s}\n'
407407
'This event will not be available in khal.')
408408
return False
409409

khal/khalendar/vdir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def create(cls, collection_name: PathLike, **kwargs: PathLike) -> dict[str, Path
197197
if not os.path.exists(pathn):
198198
os.makedirs(pathn, mode=cls.default_mode)
199199
elif not os.path.isdir(pathn):
200-
raise OSError(f'{repr(pathn)} is not a directory.')
200+
raise OSError(f'{pathn!r} is not a directory.')
201201

202202
kwargs['path'] = pathn
203203
return kwargs

khal/settings/khal.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type = option('calendar', 'birthdays', 'discover', default='calendar')
7777
addresses = force_list(default='')
7878

7979
[sqlite]
80-
# khal stores its internal caching database here, by default this will be in the *$XDG_DATA_HOME/khal/khal.db* (this will most likely be *~/.local/share/khal/khal.db*).
80+
# khal stores its internal caching database here, by default this will be in the *$XDG_CACHE_HOME/khal/khal.db* (this will most likely be *~/.cache/khal/khal.db*).
8181
path = expand_db_path(default=None)
8282

8383
# It is mandatory to set (long)date-, time-, and datetimeformat options, all others options in the **[locale]** section are optional and have (sensible) defaults.

khal/settings/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_config(
129129
logger.fatal(
130130
'config error:\n'
131131
f'in {sectionize(section + [subsection])} {key}: '
132-
f'{str(config_error[key])}'
132+
f'{config_error[key]!s}'
133133
)
134134

135135
if abort or not results:

khal/settings/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ def expand_path(path: str) -> str:
113113

114114

115115
def expand_db_path(path: str) -> str:
116-
"""expands `~` as well as variable names, defaults to $XDG_DATA_HOME"""
116+
"""expands `~` as well as variable names, defaults to $XDG_CACHE_HOME"""
117117
if path is None:
118-
path = join(xdg.BaseDirectory.xdg_data_home, 'khal', 'khal.db')
118+
path = join(xdg.BaseDirectory.xdg_cache_home, 'khal', 'khal.db')
119119
return expanduser(expandvars(path))
120120

121121

0 commit comments

Comments
 (0)