<s> import archive <EOL> import exceptions <EOL> import os <EOL> from os . path import dirname , exists , join , realpath <EOL> PACKAGE_ROOT = dirname ( realpath ( __file__ ) ) <EOL> APPLE_CERT_PATH = join ( PACKAGE_ROOT , '<STR_LIT>' , '<STR_LIT>' ) <EOL> if exists ( join ( os . environ [ '<STR_LIT>' ] , '<STR_LIT>' ) ) : <EOL> DEFAULT_CREDENTIALS_PATH = join ( os . environ [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> CERTIFICATE_PATH = join ( DEFAULT_CREDENTIALS_PATH , '<STR_LIT>' ) <EOL> KEY_PATH = join ( DEFAULT_CREDENTIALS_PATH , '<STR_LIT>' ) <EOL> PROVISIONING_PROFILE_PATH = join ( DEFAULT_CREDENTIALS_PATH , <EOL> '<STR_LIT>' ) <EOL> else : <EOL> DEFAULT_CREDENTIALS_PATH = join ( os . environ [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> CERTIFICATE_PATH = join ( DEFAULT_CREDENTIALS_PATH , '<STR_LIT>' ) <EOL> KEY_PATH = join ( DEFAULT_CREDENTIALS_PATH , '<STR_LIT>' ) <EOL> PROVISIONING_PROFILE_PATH = join ( DEFAULT_CREDENTIALS_PATH , <EOL> '<STR_LIT>' ) <EOL> class NotSignable ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def resign ( input_path , <EOL> certificate = CERTIFICATE_PATH , <EOL> key = KEY_PATH , <EOL> apple_cert = APPLE_CERT_PATH , <EOL> provisioning_profile = PROVISIONING_PROFILE_PATH , <EOL> output_path = join ( os . getcwd ( ) , "<STR_LIT>" ) ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return archive . resign ( input_path , <EOL> certificate , <EOL> key , <EOL> apple_cert , <EOL> provisioning_profile , <EOL> output_path ) <EOL> except exceptions . NotSignable as e : <EOL> raise NotSignable ( e ) </s>
