MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / __get_ver_pre_38

Function __get_ver_pre_38

PySimpleGUI/PySimpleGUI.py:24693–24721  ·  view source on GitHub ↗

Function that shows all versions of a package

(interpreter, package)

Source from the content-addressed store, hash-verified

24691 return ver if ver != ' ' else ''
24692
24693def __get_ver_pre_38(interpreter, package):
24694 """
24695 Function that shows all versions of a package
24696 """
24697 # interpreter = sys.executable
24698 # sg.cprint(f'{interpreter} ', end='', c='red')
24699 pstr = __make_str_pre_38(package)
24700
24701
24702
24703 # Now you can use 'temp_file.name' as the path to your temporary file
24704 # Remember to delete it manually when you're done (or set 'delete=True' when creating it)
24705
24706 # Create a temporary file securely
24707 with tempfile.NamedTemporaryFile(mode='w', delete=False) as file:
24708 file.write(pstr)
24709 file.seek(0)
24710 temp_file = file.name
24711
24712
24713 # temp_file = os.path.join(os.path.dirname(__file__), 'temp_py.py')
24714 # with open(temp_file, 'w') as file:
24715 # file.write(pstr)
24716 sp = execute_py_file(temp_file, interpreter_command=interpreter, pipe_output=True,merge_stderr_with_stdout=False, wait=False)
24717 out, err = execute_get_results(sp)
24718 if err:
24719 out = ''
24720 os.remove(temp_file)
24721 return out
24722
24723def __get_ver_38_later(interpreter, package):
24724 """

Callers 1

__get_ver_threadFunction · 0.85

Calls 5

__make_str_pre_38Function · 0.85
execute_get_resultsFunction · 0.85
writeMethod · 0.80
removeMethod · 0.80
execute_py_fileFunction · 0.70

Tested by

no test coverage detected