Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
only import os.sep instead of the whole module
  • Loading branch information
seapat authored Nov 17, 2021
1 parent d393c1e commit 0d6f944
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions olsync/olclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import uuid
from socketIO_client import SocketIO
import time
import os
from os import sep

# Where to get the CSRF Token and where to send the login request to
LOGIN_URL = "https://www.overleaf.com/login"
Expand Down Expand Up @@ -205,8 +205,8 @@ def upload_file(self, project_id, project_infos, file_name, file_size, file):
folder_id = project_infos['rootFolder'][0]['_id']

# The file name contains path separators, check folders
if os.sep in file_name:
local_folders = file_name.split(os.sep)[:-1] # Remove last item since this is the file name
if sep in file_name:
local_folders = file_name.split(sep)[:-1] # Remove last item since this is the file name
current_overleaf_folder = project_infos['rootFolder'][0]['folders'] # Set the current remote folder

for local_folder in local_folders:
Expand Down

0 comments on commit 0d6f944

Please sign in to comment.