Skip to content

Commit 2ba52e2

Browse files
committed
Revised some doc strings.
1 parent f22fda1 commit 2ba52e2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

autograder/api/config.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ def get_local_config_path(local_scope = None):
113113
elif (os.path.isfile(LEGACY_CONFIG_FILENAME)):
114114
return os.path.abspath(LEGACY_CONFIG_FILENAME)
115115
else:
116-
current_path = os.getcwd()
117-
dir_path = pathlib.Path(current_path)
118-
116+
dir_path = pathlib.Path(os.getcwd())
119117
return _get_config_path(dir_path.parent, local_scope = local_scope)
120118

121119
def get_tiered_config(
@@ -207,7 +205,7 @@ def get_argument_parser(
207205

208206
parser.add_argument('-v', '--verbose', dest = 'verbose',
209207
action = 'store_true', default = False,
210-
help = 'Output detailed information about the operation and results.'
208+
help = 'Output detailed information about the operation and results'
211209
+ " (default: %(default)s).")
212210

213211
for param in params:
@@ -223,15 +221,16 @@ def get_argument_parser(
223221

224222
return parser
225223

226-
def _get_config_path(current_directory, local_scope = None, config_name = DEFAULT_CONFIG_FILENAME):
224+
def _get_config_path(current_directory, config_file = DEFAULT_CONFIG_FILENAME, local_scope = None):
227225
"""
228226
Search through the parent directories (until root) for a configuration file.
229-
Stops at the first occurrence of specified config name (default: autograder.json)
230-
along the path to root. Returns the path if a configuration file is found.
227+
Stops at the first occurrence of the specified config file
228+
(default: autograder.json) along the path to root.
229+
Returns the path if a configuration file is found.
231230
Otherwise, returns None.
232231
"""
233232
current_path = pathlib.Path(current_directory)
234-
config_file_path = os.path.join(current_path, config_name)
233+
config_file_path = os.path.join(current_path, config_file)
235234

236235
if (os.path.isfile(config_file_path)):
237236
return config_file_path
@@ -244,7 +243,11 @@ def _get_config_path(current_directory, local_scope = None, config_name = DEFAUL
244243
if current_path.parent == current_path:
245244
return None
246245

247-
return _get_config_path(current_path.parent, local_scope = local_scope)
246+
return _get_config_path(
247+
current_path.parent,
248+
config_file = config_file,
249+
local_scope = local_scope
250+
)
248251

249252
def _submission_add_func(parser, param):
250253
parser.add_argument('submissions', metavar = 'SUBMISSION',

0 commit comments

Comments
 (0)