示例#1
0
 def do_test(self):
     filename = self.value.strip()
     allowed = filter_filename(map(compile_rule, self.rules), filename)
     if allowed is None:
         self.result.setText(_('The filename %s did not match any rules') % filename)
     else:
         self.result.setText(_('The filename {0} will be {1}').format(filename, _('added' if allowed else 'ignored')))
示例#2
0
 def do_test(self):
     filename = self.value.strip()
     allowed = filter_filename(map(compile_rule, self.rules), filename)
     if allowed is None:
         self.result.setText(_('The filename %s did not match any rules') % filename)
     else:
         self.result.setText(_('The filename {0} will be {1}').format(filename, _('added' if allowed else 'ignored')))
示例#3
0
 def is_filename_allowed(self, filename):
     allowed = filter_filename(self.compiled_rules, filename)
     if allowed is None:
         ext = os.path.splitext(filename)[1][1:].lower()
         allowed = ext in self.allowed
     return allowed
示例#4
0
 def is_filename_allowed(self, filename):
     allowed = filter_filename(self.compiled_rules, filename)
     if allowed is None:
         ext = os.path.splitext(filename)[1][1:].lower()
         allowed = ext in self.allowed
     return allowed