mirror of
https://github.com/elliotnunn/supermario.git
synced 2024-11-26 01:49:19 +00:00
f4d0dadebe
Also, factor out some common code
10 lines
318 B
Python
10 lines
318 B
Python
from os import path
|
|
|
|
def folder(default_search, user_input):
|
|
if path.sep in user_input or user_input in ('..', '.'):
|
|
return user_input
|
|
else:
|
|
the_path = path.dirname(path.dirname(path.abspath(__file__)))
|
|
the_path = path.join(the_path, default_search, user_input)
|
|
return the_path
|