Skip to content

Commit 439f1e6

Browse files
just1602WhyNotHugo
authored andcommitted
Run ruff --fix vdirsyncer
1 parent ef8e898 commit 439f1e6

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

vdirsyncer/cli/tasks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ async def repair_collection(
121121
break
122122
else:
123123
raise exceptions.UserError(
124-
"Couldn't find collection {} for storage {}.".format(
125-
collection, storage_name
126-
)
124+
f"Couldn't find collection {collection} for storage {storage_name}."
127125
)
128126

129127
config["type"] = storage_type

vdirsyncer/cli/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ def assert_permissions(path, wanted):
323323
permissions = os.stat(path).st_mode & 0o777
324324
if permissions > wanted:
325325
cli_logger.warning(
326-
"Correcting permissions of {} from {:o} to {:o}".format(
327-
path, permissions, wanted
328-
)
326+
f"Correcting permissions of {path} from {permissions:o} to {wanted:o}"
329327
)
330328
os.chmod(path, wanted)
331329

vdirsyncer/storage/dav.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ async def _find_principal_impl(self, url) -> str:
198198
# E.g. Synology NAS
199199
# See https://github.com/pimutils/vdirsyncer/issues/498
200200
dav_logger.debug(
201-
"No current-user-principal returned, re-using URL {}".format(
202-
response.url
203-
)
201+
f"No current-user-principal returned, re-using URL {response.url}"
204202
)
205203
return response.url.human_repr()
206204
return urlparse.urljoin(str(response.url), rv.text).rstrip("/") + "/"
@@ -649,9 +647,7 @@ def _parse_prop_responses(self, root, handled_hrefs=None):
649647
contenttype = getattr(props.find("{DAV:}getcontenttype"), "text", None)
650648
if not self._is_item_mimetype(contenttype):
651649
dav_logger.debug(
652-
"Skipping {!r}, {!r} != {!r}.".format(
653-
href, contenttype, self.item_mimetype
654-
)
650+
f"Skipping {href!r}, {contenttype!r} != {self.item_mimetype!r}."
655651
)
656652
continue
657653

@@ -831,9 +827,7 @@ def _get_list_filters(components, start, end):
831827
start = start.strftime(CALDAV_DT_FORMAT)
832828
end = end.strftime(CALDAV_DT_FORMAT)
833829

834-
timefilter = '<C:time-range start="{start}" end="{end}"/>'.format(
835-
start=start, end=end
836-
)
830+
timefilter = f'<C:time-range start="{start}" end="{end}"/>'
837831
else:
838832
timefilter = ""
839833

vdirsyncer/sync/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ async def _run_impl(self, a, b):
205205
href = etag = None
206206
else:
207207
sync_logger.info(
208-
"Copying (uploading) item {} to {}".format(
209-
self.ident, self.dest.storage
210-
)
208+
f"Copying (uploading) item {self.ident} to {self.dest.storage}"
211209
)
212210
href, etag = await self.dest.storage.upload(self.item)
213211
assert href is not None

0 commit comments

Comments
 (0)