parameters: (self, filename, allowregex, denyregex)
docstring: Check, if filename is allowed.
          True, if matches allowreg and not denyregex.
          If allowreg is None, filename always matches
          If denyreg is None, it never matches
docstring_summary: Check, if filename is allowed.
          True, if matches allowreg and not denyregex.
          If allowreg is None, filename always matches
          If denyreg is None, it never matches
docstring_tokens: Check if filename is allowed . True if matches allowreg and not denyregex . If allowreg is None filename always matches If denyreg is None it never matches
function: def filename_is_allowed(self, filename, allowregex, denyregex):
          """
          Check, if filename is allowed.
          True, if matches allowreg and not denyregex.
          If allowreg is None, filename always matches
          If denyreg is None, it never matches
          """
          if allowregex is None or allowregex.search(filename):
              allowed = True
          else:
              allowed = False
          if denyregex is None or not denyregex.search(filename):
              denied = False
          else:
              denied = True
          if not allowed or denied:
              bareosfd.DebugMessage(100, "File %s denied by configuration\n" % (filename))
              bareosfd.JobMessage(
                  bareosfd.M_ERROR,
                  "File %s denied by configuration\n" % (filename),
              )
              return False
          else:
              return True
function_tokens: def filename_is_allowed ( self , filename , allowregex , denyregex ) : if allowregex is None or allowregex . search ( filename ) : allowed = True else : allowed = False if denyregex is None or not denyregex . search ( filename ) : denied = False else : denied = True if not allowed or denied : bareosfd . DebugMessage ( 100 , "File %s denied by configuration\n" % ( filename ) ) bareosfd . JobMessage ( bareosfd . M_ERROR , "File %s denied by configuration\n" % ( filename ) , ) return False else : return True