Merge pull request #4951 from PySimpleGUI/Dev-latest

SDK Reference - changed to inspect.getfullargspec because inspect.get…
This commit is contained in:
PySimpleGUI 2021-11-10 12:04:52 -05:00 committed by GitHub
commit 9c2f547f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 75 additions and 72 deletions

View File

@ -1,12 +1,14 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.55.1.1 Released 7-Nov-2021" version = __version__ = "4.55.1.2 Unreleased"
_change_log = """ _change_log = """
Changelog since 4.55.1 released to PyPI on 7-Nov-2021 Changelog since 4.55.1 released to PyPI on 7-Nov-2021
4.55.1.1 4.55.1.1
Addition of stdin parm to execute_command_subprocess. This is to fix problem when pyinstaller is used to make an EXE from a psg program that calls this function Addition of stdin parm to execute_command_subprocess. This is to fix problem when pyinstaller is used to make an EXE from a psg program that calls this function
4.55.1.2
Changed getargspec call in the SDK Reference window to getfullargspec. In 3.11 getargspec is no longer supported and thus crashes
Added try to SDK Reference event loop to catch any additional problems that may pop up in 3.11
""" """
__version__ = version.split()[0] # For PEP 396 and PEP 345 __version__ = version.split()[0] # For PEP 396 and PEP 345
@ -169,11 +171,10 @@ try:
except: except:
webbrowser_available = False webbrowser_available = False
# used for github upgrades # used for github upgrades
import sys
import urllib.request import urllib.request
import urllib.error import urllib.error
import urllib.parse import urllib.parse
import pydoc
from urllib import request from urllib import request
import os import os
import sys import sys
@ -22546,8 +22547,8 @@ def main_sdk_help():
for element in element_classes: for element in element_classes:
# Build info about init method # Build info about init method
args = inspect.getargspec(element.__init__).args[1:] args = inspect.getfullargspec(element.__init__).args[1:]
defaults = inspect.getargspec(element.__init__).defaults defaults = inspect.getfullargspec(element.__init__).defaults
# print('------------- {element}----------') # print('------------- {element}----------')
# print(args) # print(args)
# print(defaults) # print(defaults)
@ -22561,8 +22562,8 @@ def main_sdk_help():
# Build info about update method # Build info about update method
try: try:
args = inspect.getargspec(element.update).args[1:] args = inspect.getfullargspec(element.update).args[1:]
defaults = inspect.getargspec(element.update).defaults defaults = inspect.getfullargspec(element.update).defaults
if args is None or defaults is None: if args is None or defaults is None:
element_arg_default_dict_update[element.__name__] = (('', ''),) element_arg_default_dict_update[element.__name__] = (('', ''),)
continue continue
@ -22594,6 +22595,7 @@ def main_sdk_help():
online_help_link = '' online_help_link = ''
ml = window['-ML-'] ml = window['-ML-']
current_element = '' current_element = ''
try:
while True: # Event Loop while True: # Event Loop
event, values = window.read() event, values = window.read()
if event in (WIN_CLOSED, 'Exit'): if event in (WIN_CLOSED, 'Exit'):
@ -22611,7 +22613,7 @@ def main_sdk_help():
window['-DOC LINK-'].update(online_help_link) window['-DOC LINK-'].update(online_help_link)
if not values['-SUMMARY-']: if not values['-SUMMARY-']:
elem = element_names[event] elem = element_names[event]
ml.print(help(elem)) ml.print(pydoc.help(elem))
# print the aliases for the class # print the aliases for the class
ml.print('\n--- Shortcut Aliases for Class ---') ml.print('\n--- Shortcut Aliases for Class ---')
for v in vars3: for v in vars3:
@ -22661,9 +22663,10 @@ def main_sdk_help():
ml.print(f) ml.print(f)
else: else:
ml.print('=========== ' + f + '===========', background_color='#FFFF00', text_color='black') ml.print('=========== ' + f + '===========', background_color='#FFFF00', text_color='black')
ml.print(help(f_entry[1])) ml.print(pydoc.help(f_entry[1]))
ml.set_vscroll_position(0) # scroll to top of multoline ml.set_vscroll_position(0) # scroll to top of multoline
except Exception as e:
_error_popup_with_traceback('Exception in SDK reference', e)
window.close() window.close()