#NEWLINE# def __init__( self , filename = None , sign = False , verify = False ) : #NEWLINE# #INDENT# '\n        Initialise an instance using a (valid) filename.\n        ' #NEWLINE# self . sign = sign #NEWLINE# self . should_verify = verify #NEWLINE# self . buildver = '' #NEWLINE# self . pyver = [ PYVER ] #NEWLINE# self . abi = [ 'none' ] #NEWLINE# self . arch = [ 'any' ] #NEWLINE# self . dirname = os . getcwd ( ) #NEWLINE# if ( filename is None ) : #NEWLINE# #INDENT# self . name = 'dummy' #NEWLINE# self . version = '0.1' #NEWLINE# self . _filename = self . filename #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# m = NAME_VERSION_RE . match ( filename ) #NEWLINE# if m : #NEWLINE# #INDENT# info = m . groupdict ( '' ) #NEWLINE# self . name = info [ 'nm' ] #NEWLINE# self . version = info [ 'vn' ] . replace ( '_' , '-' ) #NEWLINE# self . buildver = info [ 'bn' ] #NEWLINE# self . _filename = self . filename #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( dirname , filename ) = os . path . split ( filename ) #NEWLINE# m = FILENAME_RE . match ( filename ) #NEWLINE# if ( not m ) : #NEWLINE# #INDENT# raise DistlibException ( ( 'Invalid name or filename: %r' % filename ) ) #NEWLINE# #UNINDENT# if dirname : #NEWLINE# #INDENT# self . dirname = os . path . abspath ( dirname ) #NEWLINE# #UNINDENT# self . _filename = filename #NEWLINE# info = m . groupdict ( '' ) #NEWLINE# self . name = info [ 'nm' ] #NEWLINE# self . version = info [ 'vn' ] #NEWLINE# self . buildver = info [ 'bn' ] #NEWLINE# self . pyver = info [ 'py' ] . split ( '.' ) #NEWLINE# self . abi = info [ 'bi' ] . split ( '.' ) #NEWLINE# self . arch = info [ 'ar' ] . split ( '.' )