ja_env/lib/python3.7/site-packages/pry.py
def ls(self, query):
                    """
                    Show local variables/methods/class properties
                    """
                    lines = []
                    width = terminal_size()[0]

                    methods = []
                    properties = []
                    has_query = True

                    that = self.shell.user_ns.get(query, None)

                    if that is None:
                        that = self.active_frame.locals.get("self", [])
                        has_query = False

                    # apparently there is no better way to check if the caller
                    # is a method
                    for attr in dir(that):
                        try:
                            value = getattr(that, attr)
                        except Exception:
                            continue
                        if isinstance(value, types.MethodType):
                            methods.append(attr)
                        else:
                            properties.append(attr)

                    if len(methods) > 0:
                        lines.append("local methods:")
                        lines.extend(self.build_terminal_list(methods, width))

                    if len(properties) > 0:
                        lines.append("properties")
                        props = self.build_terminal_list(properties, width)
                        lines.extend(props)

                    if not has_query:
                        lines.append("local variables:")
                        local_vars = self.build_terminal_list(
                            self.active_frame.locals.keys(), width)
                        lines.extend(local_vars)

                    page.page("\n".join(lines))

                    Show local variables/methods/class properties
                    
Show local variables/methods/class properties
Show local variables / methods / class properties
def ls(self, query):
                    lines = []
                    width = terminal_size()[0]
                    methods = []
                    properties = []
                    has_query = True
                    that = self.shell.user_ns.get(query, None)
                    if that is None:
                        that = self.active_frame.locals.get("self", [])
                        has_query = False
                    for attr in dir(that):
                        try:
                            value = getattr(that, attr)
                        except Exception:
                            continue
                        if isinstance(value, types.MethodType):
                            methods.append(attr)
                        else:
                            properties.append(attr)
                    if len(methods) > 0:
                        lines.append("local methods:")
                        lines.extend(self.build_terminal_list(methods, width))
                    if len(properties) > 0:
                        lines.append("properties")
                        props = self.build_terminal_list(properties, width)
                        lines.extend(props)
                    if not has_query:
                        lines.append("local variables:")
                        local_vars = self.build_terminal_list(
                            self.active_frame.locals.keys(), width)
                        lines.extend(local_vars)
                    page.page("\n".join(lines))
def ls ( self , query ) : lines = [ ] width = terminal_size ( ) [ 0 ] methods = [ ] properties = [ ] has_query = True that = self . shell . user_ns . get ( query , None ) if that is None : that = self . active_frame . locals . get ( "self" , [ ] ) has_query = False for attr in dir ( that ) : try : value = getattr ( that , attr ) except Exception : continue if isinstance ( value , types . MethodType ) : methods . append ( attr ) else : properties . append ( attr ) if len ( methods ) > 0 : lines . append ( "local methods:" ) lines . extend ( self . build_terminal_list ( methods , width ) ) if len ( properties ) > 0 : lines . append ( "properties" ) props = self . build_terminal_list ( properties , width ) lines . extend ( props ) if not has_query : lines . append ( "local variables:" ) local_vars = self . build_terminal_list ( self . active_frame . locals . keys ( ) , width ) lines . extend ( local_vars ) page . page ( "\n" . join ( lines ) )
Show local variables/methods/class properties
Show local variables / methods / class properties
"""
                    Show local variables/methods/class properties
                    """ # apparently there is no better way to check if the caller # is a method
self
query