#NEWLINE# def __init__( self , dr_input ) : #NEWLINE# #INDENT# 'Initializes an OGR driver on either a string or integer input.' #NEWLINE# if isinstance ( dr_input , six . string_types ) : #NEWLINE# #INDENT# self . _register ( ) #NEWLINE# if ( dr_input . lower ( ) in self . _alias ) : #NEWLINE# #INDENT# name = self . _alias [ dr_input . lower ( ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = dr_input #NEWLINE# #UNINDENT# dr = capi . get_driver_by_name ( force_bytes ( dr ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( dr_input , int ) : #NEWLINE# #INDENT# self . _register ( ) #NEWLINE# dr = capi . get_driver ( dr_input ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( dr_input , c_void_p ) : #NEWLINE# #INDENT# dr = dr_input #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise OGRException ( ( 'Unrecognized input type for OGR Driver: %s' % str ( type ( dr_input ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not dr ) : #NEWLINE# #INDENT# raise OGRException ( ( 'Could not initialize OGR Driver on input: %s' % str ( dr_input ) ) ) #NEWLINE# #UNINDENT# self . ptr = dr