Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions NotionGraphsDrawer/drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


def br_text(text):
return "__" + text + "__"
return f"__{text}__"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function br_text refactored with the following changes:



def clear_text(text):
Expand Down Expand Up @@ -76,7 +76,7 @@ def check_for_completeness(object):

def random_string(string_length=10):
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(string_length))
return ''.join(random.choice(letters) for _ in range(string_length))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function random_string refactored with the following changes:



def reparse_points(points):
Expand Down Expand Up @@ -119,10 +119,10 @@ def draw_plot(client, thing, block, page):
if thing["x"] == "date":
x_axis_dates()

filename = "images/" + random_string(15) + ".png"
filename = f"images/{random_string(15)}.png"
plt.savefig(filename)

print("Uploading " + filename)
print(f"Uploading {filename}")
Comment on lines -122 to +125

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function draw_plot refactored with the following changes:

photo.upload_file(filename)


Expand Down Expand Up @@ -169,7 +169,4 @@ def index(request):
thread = Thread(target=plot)
thread.start()

return HttpResponse("Hello, world.")

else:
return HttpResponse("Hello, world.")
return HttpResponse("Hello, world.")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function index refactored with the following changes: