Skip to content

Commit 9d5e611

Browse files
committed
pr review
1 parent 63fbf5e commit 9d5e611

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

roboflow/__init__.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,14 @@ def login(workspace=None, force=False):
121121
json.dump(r_login, f, indent=2)
122122

123123
else:
124-
raise RuntimeError("Error logging in")
124+
r_login.raise_for_status()
125125

126126
return None
127127
# we could eventually return the workspace object here
128128
# return Roboflow().workspace()
129129

130-
131-
# import roboflow
132-
# roboflow.#action
133-
134130
active_workspace = None
135131

136-
137132
def initialize_roboflow():
138133
global active_workspace
139134

@@ -150,15 +145,6 @@ def initialize_roboflow():
150145

151146
return active_workspace
152147

153-
154-
def train():
155-
operate_workspace = initialize_roboflow()
156-
157-
# check if project or version is set
158-
159-
print("training from " + operate_workspace.name)
160-
161-
162148
def load_model(model_url):
163149
operate_workspace = initialize_roboflow()
164150

roboflow/config.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
import json
22
import os
33

4-
# default configuration location
5-
conf_location = os.getenv(
6-
"ROBOFLOW_CONFIG_DIR", default=os.getenv("HOME") + "/.config/roboflow/config.json"
7-
)
8-
9-
# read config file for roboflow if logged in from python or CLI
10-
if os.path.exists(conf_location):
11-
with open(conf_location) as f:
12-
config = json.load(f)
13-
else:
14-
config = {}
15-
164

175
def get_conditional_configuration_variable(key, default):
186
"""Retrieves the configuration variable conditionally.
@@ -25,6 +13,19 @@ def get_conditional_configuration_variable(key, default):
2513
Returns:
2614
string: The value of the conditional configuration variable.
2715
"""
16+
17+
# default configuration location
18+
conf_location = os.getenv(
19+
"ROBOFLOW_CONFIG_DIR", default=os.getenv("HOME") + "/.config/roboflow/config.json"
20+
)
21+
22+
# read config file for roboflow if logged in from python or CLI
23+
if os.path.exists(conf_location):
24+
with open(conf_location) as f:
25+
config = json.load(f)
26+
else:
27+
config = {}
28+
2829
if os.getenv(key) != None:
2930
return os.getenv(key)
3031
elif key in config.keys():

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
install_requires = fh.read().split('\n')
1818

1919
setuptools.setup(
20-
name="roboflowtestpypi",
20+
name="roboflow",
2121
version=version,
2222
author="Roboflow",
2323
author_email="[email protected]",

0 commit comments

Comments
 (0)