MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / openFolderClick

Function openFolderClick

src/gamesbyexample/__init__.py:153–166  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

151
152
153def openFolderClick(*args):
154 i = CURRENT_SELECTED_INDEX
155 fullFilePath = os.path.join(FOLDER_OF_THIS_FILE, PROGRAMS[i]['filename'])
156
157 if sys.platform == 'win32':
158 os.system('explorer /select,"' + fullFilePath + '"') # TODO - this doesn't open the right folder
159 elif sys.platform == 'darwin':
160 subprocess.Popen(["open", "-R", fullFilePath])
161 elif _executable_exists('nautilus'):
162 subprocess.Popen(['nautilus', '-s', fullFilePath])
163 elif _executable_exists('pcmanfm'):
164 subprocess.Popen(['pcmanfm', FOLDER_OF_THIS_FILE])
165 else:
166 pass # TODO - Figure out support for other file managers (dolphin, konqueror, etc.)
167
168
169def quitLauncher(*args):

Callers

nothing calls this directly

Calls 1

_executable_existsFunction · 0.85

Tested by

no test coverage detected