File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 12
12
from roboflow .core .workspace import Workspace
13
13
from roboflow .util .general import write_line
14
14
15
- __version__ = "1.0.2 "
15
+ __version__ = "1.0.3 "
16
16
17
17
18
18
def check_key (api_key , model , notebook , num_retries = 0 ):
@@ -72,9 +72,17 @@ def auth(api_key):
72
72
73
73
74
74
def login (workspace = None , force = False ):
75
+ os_name = os .name
76
+
77
+ if os_name == "nt" :
78
+ default_path = os .getenv ("USERPROFILE" ) + "\\ roboflow\\ config.json"
79
+ else :
80
+ default_path = os .getenv ("HOME" ) + "/.config/roboflow/config.json"
81
+
82
+ # default configuration location
75
83
conf_location = os .getenv (
76
84
"ROBOFLOW_CONFIG_DIR" ,
77
- default = os . getenv ( "HOME" ) + "/.config/roboflow/config.json" ,
85
+ default = default_path ,
78
86
)
79
87
80
88
if os .path .isfile (conf_location ) and not force :
Original file line number Diff line number Diff line change @@ -14,10 +14,17 @@ def get_conditional_configuration_variable(key, default):
14
14
string: The value of the conditional configuration variable.
15
15
"""
16
16
17
+ os_name = os .name
18
+
19
+ if os_name == "nt" :
20
+ default_path = os .getenv ("USERPROFILE" ) + "\\ roboflow\\ config.json"
21
+ else :
22
+ default_path = os .getenv ("HOME" ) + "/.config/roboflow/config.json"
23
+
17
24
# default configuration location
18
25
conf_location = os .getenv (
19
26
"ROBOFLOW_CONFIG_DIR" ,
20
- default = os . path . expanduser ( "~" ) + "/.config/roboflow/config.json" ,
27
+ default = default_path ,
21
28
)
22
29
23
30
# read config file for roboflow if logged in from python or CLI
You can’t perform that action at this time.
0 commit comments