def get_archive_tarball_name(source_dir, tarball_name, compression):
 if (tarball_name is None):
  tarball_name = os.path.basename(source_dir)
 if (not tarball_name.endswith('.tar')):
  tarball_name = ('%s.tar' % tarball_name)
 if (compression and (not tarball_name.endswith(('.%s' % compression)))):
  tarball_name = ('%s.%s' % (tarball_name, compression))
 return tarball_name

def get_archive_tarball_name ( source_dir , tarball_name , compression ) : if ( tarball_name is None ) : tarball_name = os . path . basename ( source_dir ) if ( not tarball_name . endswith ( '.tar' ) ) : tarball_name = ( '%s.tar' % tarball_name ) if ( compression and ( not tarball_name . endswith ( ( '.%s' % compression ) ) ) ) : tarball_name = ( '%s.%s' % ( tarball_name , compression ) ) return tarball_name
get the name for a tarball file .