Skip to content

Commit a613b47

Browse files
author
Gonchik Tsymzhitov
committed
Polish the example
1 parent c261d73 commit a613b47

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/confluence/confluence_attach_file.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
"""
66
import logging
7+
78
# https://pypi.org/project/python-magic/
89
import magic
910
from datetime import datetime
@@ -23,8 +24,9 @@ def attach_file(page_title, file_location, file_name, mime_type, space):
2324
if page_id is None:
2425
return 1
2526
try:
26-
confluence.attach_file(filename=file_location, name=file_name,
27-
content_type=mime_type, page_id=page_id, space=space)
27+
confluence.attach_file(
28+
filename=file_location, name=file_name, content_type=mime_type, page_id=page_id, space=space
29+
)
2830
except Exception as e:
2931
return 1
3032
return 0
@@ -38,6 +40,6 @@ def attach_file(page_title, file_location, file_name, mime_type, space):
3840
space = "TST"
3941

4042
content_type = magic.from_file(file_name, mime=True)
41-
attach_file(file_location=file_location_with_page, file_name=file_name,
42-
mime_type=content_type,
43-
page_title=title, space=space)
43+
attach_file(
44+
file_location=file_location_with_page, file_name=file_name, mime_type=content_type, page_title=title, space=space
45+
)

0 commit comments

Comments
 (0)