#NEWLINE# def create_file( self , v , name ) : #NEWLINE# #INDENT# 'Create the actual temp file.' #NEWLINE# ( root , ext ) = splitext ( name ) #NEWLINE# with open ( join ( self . temp_folder , ( '%s-%s%s' % ( root , ( 'LEFT' if ( name . side == LEFT ) else 'RIGHT' ) , ext ) ) ) , 'wb' ) as f : #NEWLINE# #INDENT# encoding = get_encoding ( v ) #NEWLINE# try : #NEWLINE# #INDENT# bfr = v . substr ( sublime . Region ( 0 , v . size ( ) ) ) . encode ( encoding ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# bfr = v . substr ( sublime . Region ( 0 , v . size ( ) ) ) . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# f . write ( bfr ) #NEWLINE# #UNINDENT# return f . name