def __decorate_docstring( func ): """ Appends additional documentation to a docstring. """ docs_DICT = __DOCSTRING_FRAGMENTS( ) _autodoc_function_parameters( func, docs_DICT ) func.__doc__ += docs_DICT[ "RTYPE_string_or_None" ] func.__doc__ += docs_DICT[ "RAISES_Unsupported_and_Undetermined" ] return func
""" osa = platform.system( ) if osa in [ "Linux", ]: return "POSIX" elif osa in [ "Darwin", ]: return "MacOS X" elif osa in [ "Windows", ]: return "Windows" else: raise UnsupportedFilesystemLayout( "Unimplemented filesystem layout classifier for {0}.", osa ) _autodoc_function_parameters( which_fs_layout, __DOCSTRING_FRAGMENTS( ) ) def __computed_MacOS_X_python_prefix( prefix ): """ If the Python prefix is for a MacOS X framework installation, then returns a truncated prefix, which can be used as a better base. Else, returns the prefix without alteration. """ match = re.findall( r".*/Python\.framework/Versions/.*", prefix ) if match: return reduce( lambda x, f: f( x ), [ dirname_of_path ] * 4, prefix ) return prefix