@synchronized(NZB_LOCK)
def save_compressed(folder, filename, data):
 here = os.getcwd()
 os.chdir(misc.short_path(folder))
 if filename.endswith('.nzb'):
  filename += '.gz'
 else:
  filename += '.nzb.gz'
 logging.info('Backing up %s', os.path.join(folder, filename))
 try:
  f = gzip.GzipFile(filename, 'wb')
  f.write(data)
  f.flush()
  f.close()
 except:
  logging.error(T('Saving %s failed'), os.path.join(folder, filename))
  logging.info('Traceback: ', exc_info=True)
 os.chdir(here)

@ synchronized ( NZB_LOCK ) def save_compressed ( folder , filename , data ) : here = os . getcwd ( ) os . chdir ( misc . short_path ( folder ) ) if filename . endswith ( '.nzb' ) : filename += '.gz' else : filename += '.nzb.gz' logging . info ( 'Backing up %s' , os . path . join ( folder , filename ) ) try : f = gzip . GzipFile ( filename , 'wb' ) f . write ( data ) f . flush ( ) f . close ( ) except : logging . error ( T ( 'Saving %s failed' ) , os . path . join ( folder , filename ) ) logging . info ( 'Traceback: ' , exc_info = True ) os . chdir ( here )
save compressed nzb file in folder .