Skip to content

Commit 09ef4af

Browse files
committed
improved code
added suggestions from pylint
1 parent acb07f7 commit 09ef4af

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

examples/configloader.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import shutil
2-
import yaml
32
import sys
43
import os.path
4+
import yaml
55

66
#TODO: change active project
77
project = "somthing-else"
88

99
def which_path():
1010
#check if os is linux
11-
if(sys.platform == "linux" or sys.platform == "linux2"):
11+
if(sys.platform in ("linux", "linux2")):
1212
path = "~/.config/gridscale"
1313
path = os.path.expanduser(path)
1414
if not os.path.exists(path):
1515
os.makedirs(path)
1616
#check if os is windows
17-
elif(sys.platform == "win32" or sys.platform == "cygwin" or sys.platform == "msys"):
17+
elif(sys.platform in ("win32", "cygwin", "msys")):
1818
path = "%APPDATA%\gridscale"
1919
path = os.path.expanduser(path)
2020
if not os.path.exists(path):
2121
os.makedirs(path)
2222
#check if os is mac os
23-
elif(sys.platform == "darwin" or sys.platform == "os2" or sys.platform == "os2emx"):
23+
elif(sys.platform in ("darwin", "os2", "os2emx")):
2424
path = "~/Library/Application Support/gridscale"
2525
path = os.path.expanduser(path)
2626
if not os.path.exists(path):
@@ -34,7 +34,6 @@ def create_config(path):
3434
cwd = os.getcwd()
3535
shutil.copyfile(f"{cwd}/config.yaml", path)
3636
print(f"New config file created, edit config file at: {path}")
37-
return
3837

3938
def load_config(projectname, goal, path):
4039
with open(f"{path}", 'r') as stream:

examples/examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from pprint import pprint
44
from uuid import uuid4
55
from index_by.key import index_by_key
6+
from configloader import load_token, load_userid
67

78
from gs_api_client import SyncGridscaleApiClient, GridscaleApiClient, models
89
from gs_api_client import Configuration
910

10-
from configloader import load_token, load_userid
1111

1212

1313
if __name__ == '__main__':

0 commit comments

Comments
 (0)