def update_profilers_in_db(profilers, description='NA', add_noncompliant=False):
 for profiler in profilers:
  name = os.path.basename(profiler)
  if name.endswith('.py'):
   name = name[:(-3)]
  if (not profilers[profiler]):
   if add_noncompliant:
    doc = description
   else:
    logging.warn('Skipping %s, missing docstring', profiler)
    continue
  else:
   doc = profilers[profiler]
  model = models.Profiler.objects.get_or_create(name=name)[0]
  model.description = doc
  _log_or_execute(repr(model), model.save)

def update_profilers_in_db ( profilers , description = 'NA' , add_noncompliant = False ) : for profiler in profilers : name = os . path . basename ( profiler ) if name . endswith ( '.py' ) : name = name [ : ( - 3 ) ] if ( not profilers [ profiler ] ) : if add_noncompliant : doc = description else : logging . warn ( 'Skipping %s, missing docstring' , profiler ) continue else : doc = profilers [ profiler ] model = models . Profiler . objects . get_or_create ( name = name ) [ 0 ] model . description = doc _log_or_execute ( repr ( model ) , model . save )
add only profilers to the database from the filesystem .