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)
| 24840 | ''' |
| 24841 | |
| 24842 | def 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 | |
| 24872 | def upgrade_PySimpleGUI_gui(no_gui=False): |
| 24873 | # print('Upgrading PySimpleGUI....') |
no test coverage detected