def preprocess_release():
 f = open('app.yaml', 'r')
 content = f.read()
 os.remove('app.yaml')
 content = content.replace('oppiaserver', APP_NAME)
 d = open('app.yaml', 'w+')
 d.write(content)
 if (not os.path.exists(DEPLOY_DATA_PATH)):
  raise Exception(('Could not find deploy_data directory at %s' % DEPLOY_DATA_PATH))
 for filename in FILES_AT_ROOT_IN_COMMON:
  src = os.path.join(DEPLOY_DATA_PATH, 'common', filename)
  dst = os.path.join(os.getcwd(), 'assets', 'common', filename)
  if (not os.path.exists(src)):
   raise Exception(('Could not find source path %s. Please check your deploy_data folder.' % src))
  if (not os.path.exists(dst)):
   raise Exception(('Could not find destination path %s. Has the code been updated in the meantime?' % dst))
  shutil.copyfile(src, dst)
 for dir_name in IMAGE_DIRS:
  src_dir = os.path.join(DEPLOY_DATA_PATH, 'images', dir_name)
  dst_dir = os.path.join(os.getcwd(), 'assets', 'images', dir_name)
  if (not os.path.exists(src_dir)):
   raise Exception(('Could not find source dir %s. Please check your deploy_data folder.' % src_dir))
  common.ensure_directory_exists(dst_dir)
  for filename in os.listdir(src_dir):
   src = os.path.join(src_dir, filename)
   dst = os.path.join(dst_dir, filename)
   shutil.copyfile(src, dst)

def preprocess_release ( ) : f = open ( 'app.yaml' , 'r' ) content = f . read ( ) os . remove ( 'app.yaml' ) content = content . replace ( 'oppiaserver' , APP_NAME ) d = open ( 'app.yaml' , 'w+' ) d . write ( content ) if ( not os . path . exists ( DEPLOY_DATA_PATH ) ) : raise Exception ( ( 'Could not find deploy_data directory at %s' % DEPLOY_DATA_PATH ) ) for filename in FILES_AT_ROOT_IN_COMMON : src = os . path . join ( DEPLOY_DATA_PATH , 'common' , filename ) dst = os . path . join ( os . getcwd ( ) , 'assets' , 'common' , filename ) if ( not os . path . exists ( src ) ) : raise Exception ( ( 'Could not find source path %s. Please check your deploy_data folder.' % src ) ) if ( not os . path . exists ( dst ) ) : raise Exception ( ( 'Could not find destination path %s. Has the code been updated in the meantime?' % dst ) ) shutil . copyfile ( src , dst ) for dir_name in IMAGE_DIRS : src_dir = os . path . join ( DEPLOY_DATA_PATH , 'images' , dir_name ) dst_dir = os . path . join ( os . getcwd ( ) , 'assets' , 'images' , dir_name ) if ( not os . path . exists ( src_dir ) ) : raise Exception ( ( 'Could not find source dir %s. Please check your deploy_data folder.' % src_dir ) ) common . ensure_directory_exists ( dst_dir ) for filename in os . listdir ( src_dir ) : src = os . path . join ( src_dir , filename ) dst = os . path . join ( dst_dir , filename ) shutil . copyfile ( src , dst )
pre-processes release files .