[bin] More robust backup procedure. [gen] Removed deprecated i18n labels.

This commit is contained in:
Gaetan Delannay 2014-03-25 15:11:21 +01:00
parent aa10572c81
commit edde17d9c8
10 changed files with 5 additions and 108 deletions

View file

@ -18,6 +18,7 @@ class ZodbBackuper:
will pack the ZODB, perform a full backup, and, if successful, remove all
previous (full and incremental) backups.'''
fullBackupExts = ('.fs', '.fsz')
allBackupExts = ('.dat', '.deltafs', '.deltafsz') + fullBackupExts
toRemoveExts = ('.doc', '.pdf', '.rtf', '.odt')
def __init__(self, storageLocation, backupFolder, options):
self.storageLocation = storageLocation
@ -140,7 +141,8 @@ class ZodbBackuper:
w('Last full backup date: %s' % str(oldestFullBackupDate))
for backupFile in os.listdir(self.backupFolder):
fileDate, ext = os.path.splitext(backupFile)
if self.getDate(fileDate) < oldestFullBackupDate:
if (ext in self.allBackupExts) and \
(self.getDate(fileDate) < oldestFullBackupDate):
fullFileName = '%s/%s' % (self.backupFolder, backupFile)
w('Removing old backup file %s...' % fullFileName)
os.remove(fullFileName)

View file

@ -624,7 +624,7 @@ class Field:
# master/slave relationships, we consider it not to be required.
return obj.translate('field_required')
else:
return None
return
# Perform security checks on p_value
self.securityCheck(obj, value)
# Triggers the sub-class-specific validation for this value
@ -652,15 +652,6 @@ class Field:
else:
# It is a regular expression
if not self.validator.match(value):
# If the regular expression is among the default ones, we
# generate a specific error message.
if self.validator == String.EMAIL:
return obj.translate('bad_email')
elif self.validator == String.URL:
return obj.translate('bad_url')
elif self.validator == String.ALPHANUMERIC:
return obj.translate('bad_alphanumeric')
else:
return obj.translate('field_invalid')
def store(self, obj, value):

View file

@ -163,18 +163,6 @@ msgstr ""
msgid "bad_date"
msgstr ""
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr ""
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr ""
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr ""
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr ""

View file

@ -163,18 +163,6 @@ msgstr ""
msgid "bad_date"
msgstr ""
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr ""
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr ""
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr ""
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr ""

View file

@ -163,18 +163,6 @@ msgstr "Füllen Sie einen reellen Wert ein."
msgid "bad_date"
msgstr ""
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr "Präzisieren Sie eine gültige E-Mail-Adresse."
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr "Präzisieren Sie eine gültige URL."
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr "Bestimmen Sie einen gültigen alfanumerischen Wert."
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr "Dieser Wert wird in diesem Feld nicht akzeptiert."

View file

@ -164,18 +164,6 @@ msgstr "A floating-point number is expected; use the dot as decimal separator, n
msgid "bad_date"
msgstr "Please specify a valid date."
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr "Please enter a valid email."
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr "Please enter a valid URL."
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr "Please enter a valid alphanumeric value."
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr "The value is not among possible values for this field."

View file

@ -163,18 +163,6 @@ msgstr "Un valor real es requerido."
msgid "bad_date"
msgstr ""
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr "Por favor especifique un e-mail válido.\""
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr "Por favor especifique un URL valído."
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr "Por favor especifique une valor alfanumérico válido."
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr "Este valor no es permitido para este campo."

View file

@ -164,18 +164,6 @@ msgstr "Une valeur réelle est attendue."
msgid "bad_date"
msgstr "Veuillez spécifier une date valide."
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr "Veuillez spécifier un e-mail valide."
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr "Veuillez spécifier une URL valide."
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr "Veuillez spécifier une valeur alphanumérique valide."
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr "Cette valeur n'est pas permise pour ce champ."

View file

@ -163,18 +163,6 @@ msgstr "Ci si aspetta un numero con decimali"
msgid "bad_date"
msgstr ""
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr "Digiti un indirizzo e-mail valido"
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr "Digiti un URL valido."
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr "Digiti un valore alfanumerico valido."
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr "Il valore digitato non è possibile per questo campo."

View file

@ -163,18 +163,6 @@ msgstr "Vul een reële waarde in."
msgid "bad_date"
msgstr ""
#. Default: "Please enter a valid email."
msgid "bad_email"
msgstr "Specifieer een geldig e-mail adres"
#. Default: "Please enter a valid URL."
msgid "bad_url"
msgstr "Specifieer een geldig URL."
#. Default: "Please enter a valid alphanumeric value."
msgid "bad_alphanumeric"
msgstr "Specifieer een geldige alfnumerische waarde."
#. Default: "The value is not among possible values for this field."
msgid "bad_select_value"
msgstr "Deze waarde wordt niet geaccepteerd voor dit veld."