(self, object, basedir=sysconfig.get_path('stdlib'))
return docloc
Return the location of module docs or None
Return the location of module docs or None
Return the location of module docs or None
def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
        """Return the location of module docs or None"""

        try:
            file = inspect.getabsfile(object)
        except TypeError:
            file = '(built-in)'

        docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)

        basedir = os.path.normcase(basedir)
        if (isinstance(object, type(os)) and
            (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
                                 'marshal', 'posix', 'signal', 'sys',
                                 '_thread', 'zipimport') or
             (file.startswith(basedir) and
              not file.startswith(os.path.join(basedir, 'site-packages')))) and
            object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
            if docloc.startswith(("http://", "https://")):
                docloc = "{}/{}.html".format(docloc.rstrip("/"), object.__name__.lower())
            else:
                docloc = os.path.join(docloc, object.__name__.lower() + ".html")
        else:
            docloc = None
        return docloc
def getdocloc ( self , object , basedir = sysconfig . get_path ( 'stdlib' ) ) : try : file = inspect . getabsfile ( object ) except TypeError : file = '(built-in)' docloc = os . environ . get ( "PYTHONDOCS" , self . PYTHONDOCS ) basedir = os . path . normcase ( basedir ) if ( isinstance ( object , type ( os ) ) and ( object . __name__ in ( 'errno' , 'exceptions' , 'gc' , 'imp' , 'marshal' , 'posix' , 'signal' , 'sys' , '_thread' , 'zipimport' ) or ( file . startswith ( basedir ) and not file . startswith ( os . path . join ( basedir , 'site-packages' ) ) ) ) and object . __name__ not in ( 'xml.etree' , 'test.pydoc_mod' ) ) : if docloc . startswith ( ( "http://" , "https://" ) ) : docloc = "{}/{}.html" . format ( docloc . rstrip ( "/" ) , object . __name__ . lower ( ) ) else : docloc = os . path . join ( docloc , object . __name__ . lower ( ) + ".html" ) else : docloc = None return docloc