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

Function upgrade_get_github_setuppy_version

PySimpleGUI/PySimpleGUI.py:24842–24870  ·  view source on GitHub ↗

Returns the version number found in the setup.py in the PySimpleGUI Github :param silent_error: If True then no error message displayed if error occurs :type silent_error: bool :returns: Version number as a string. Will be empty string if error :rtype:

(silent_error=True)

Source from the content-addressed store, hash-verified

24840'''
24841
24842def upgrade_get_github_setuppy_version(silent_error=True):
24843 """
24844 Returns the version number found in the setup.py in the PySimpleGUI Github
24845
24846 :param silent_error: If True then no error message displayed if error occurs
24847 :type silent_error: bool
24848 :returns: Version number as a string. Will be empty string if error
24849 :rtype: str
24850 """
24851 setup_py = net_download_file(URL_PSG_GITHUB_SETUP_FILE)
24852 if setup_py is None:
24853 if not silent_error:
24854 popup_error('Upgrade GUI - error downloading the setup.py file')
24855 return ''
24856
24857 lines = setup_py.splitlines()
24858 new_ver = None
24859 for line in lines:
24860 if 'version=' in line:
24861 running_ver = line.split('=')[1]
24862 start = running_ver.find('"')
24863 end = running_ver.find('"', start + 1)
24864 new_ver = running_ver[start + 1:end]
24865 break
24866 if not new_ver:
24867 if not silent_error:
24868 popup_error('Upgrade GUI - did not find version number is setup.py')
24869 return ''
24870 return new_ver
24871
24872def upgrade_PySimpleGUI_gui(no_gui=False):
24873 # print('Upgrading PySimpleGUI....')

Callers 2

upgrade_PySimpleGUI_guiFunction · 0.85
_create_main_windowFunction · 0.85

Calls 2

net_download_fileFunction · 0.85
popup_errorFunction · 0.85

Tested by

no test coverage detected