[bin] More robust backup procedure. [gen] Removed deprecated i18n labels.
This commit is contained in:
		
							parent
							
								
									aa10572c81
								
							
						
					
					
						commit
						edde17d9c8
					
				
					 10 changed files with 5 additions and 108 deletions
				
			
		| 
						 | 
					@ -18,6 +18,7 @@ class ZodbBackuper:
 | 
				
			||||||
       will pack the ZODB, perform a full backup, and, if successful, remove all
 | 
					       will pack the ZODB, perform a full backup, and, if successful, remove all
 | 
				
			||||||
       previous (full and incremental) backups.'''
 | 
					       previous (full and incremental) backups.'''
 | 
				
			||||||
    fullBackupExts = ('.fs', '.fsz')
 | 
					    fullBackupExts = ('.fs', '.fsz')
 | 
				
			||||||
 | 
					    allBackupExts = ('.dat', '.deltafs', '.deltafsz') + fullBackupExts
 | 
				
			||||||
    toRemoveExts = ('.doc', '.pdf', '.rtf', '.odt')
 | 
					    toRemoveExts = ('.doc', '.pdf', '.rtf', '.odt')
 | 
				
			||||||
    def __init__(self, storageLocation, backupFolder, options):
 | 
					    def __init__(self, storageLocation, backupFolder, options):
 | 
				
			||||||
        self.storageLocation = storageLocation
 | 
					        self.storageLocation = storageLocation
 | 
				
			||||||
| 
						 | 
					@ -140,7 +141,8 @@ class ZodbBackuper:
 | 
				
			||||||
            w('Last full backup date: %s' % str(oldestFullBackupDate))
 | 
					            w('Last full backup date: %s' % str(oldestFullBackupDate))
 | 
				
			||||||
        for backupFile in os.listdir(self.backupFolder):
 | 
					        for backupFile in os.listdir(self.backupFolder):
 | 
				
			||||||
            fileDate, ext = os.path.splitext(backupFile)
 | 
					            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)
 | 
					                fullFileName = '%s/%s' % (self.backupFolder, backupFile)
 | 
				
			||||||
                w('Removing old backup file %s...' % fullFileName)
 | 
					                w('Removing old backup file %s...' % fullFileName)
 | 
				
			||||||
                os.remove(fullFileName)
 | 
					                os.remove(fullFileName)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -624,7 +624,7 @@ class Field:
 | 
				
			||||||
                # master/slave relationships, we consider it not to be required.
 | 
					                # master/slave relationships, we consider it not to be required.
 | 
				
			||||||
                return obj.translate('field_required')
 | 
					                return obj.translate('field_required')
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                return None
 | 
					                return
 | 
				
			||||||
        # Perform security checks on p_value
 | 
					        # Perform security checks on p_value
 | 
				
			||||||
        self.securityCheck(obj, value)
 | 
					        self.securityCheck(obj, value)
 | 
				
			||||||
        # Triggers the sub-class-specific validation for this value
 | 
					        # Triggers the sub-class-specific validation for this value
 | 
				
			||||||
| 
						 | 
					@ -652,16 +652,7 @@ class Field:
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                # It is a regular expression
 | 
					                # It is a regular expression
 | 
				
			||||||
                if not self.validator.match(value):
 | 
					                if not self.validator.match(value):
 | 
				
			||||||
                    # If the regular expression is among the default ones, we
 | 
					                    return obj.translate('field_invalid')
 | 
				
			||||||
                    # 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):
 | 
					    def store(self, obj, value):
 | 
				
			||||||
        '''Stores the p_value (produced by m_getStorableValue) that complies to
 | 
					        '''Stores the p_value (produced by m_getStorableValue) that complies to
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -163,18 +163,6 @@ msgstr ""
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr ""
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr ""
 | 
					msgstr ""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/ar.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/ar.po
									
										
									
									
									
								
							| 
						 | 
					@ -163,18 +163,6 @@ msgstr ""
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr ""
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr ""
 | 
					msgstr ""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/de.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/de.po
									
										
									
									
									
								
							| 
						 | 
					@ -163,18 +163,6 @@ msgstr "Füllen Sie einen reellen Wert ein."
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr ""
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr "Dieser Wert wird in diesem Feld nicht akzeptiert."
 | 
					msgstr "Dieser Wert wird in diesem Feld nicht akzeptiert."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/en.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/en.po
									
										
									
									
									
								
							| 
						 | 
					@ -164,18 +164,6 @@ msgstr "A floating-point number is expected; use the dot as decimal separator, n
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr "Please specify a valid 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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr "The value is not among possible values for this field."
 | 
					msgstr "The value is not among possible values for this field."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/es.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/es.po
									
										
									
									
									
								
							| 
						 | 
					@ -163,18 +163,6 @@ msgstr "Un valor real es requerido."
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr ""
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr "Este valor no es permitido para este campo."
 | 
					msgstr "Este valor no es permitido para este campo."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/fr.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/fr.po
									
										
									
									
									
								
							| 
						 | 
					@ -164,18 +164,6 @@ msgstr "Une valeur réelle est attendue."
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr "Veuillez spécifier une date valide."
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr "Cette valeur n'est pas permise pour ce champ."
 | 
					msgstr "Cette valeur n'est pas permise pour ce champ."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/it.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/it.po
									
										
									
									
									
								
							| 
						 | 
					@ -163,18 +163,6 @@ msgstr "Ci si aspetta un numero con decimali"
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr ""
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr "Il valore digitato non è possibile per questo campo."
 | 
					msgstr "Il valore digitato non è possibile per questo campo."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								gen/tr/nl.po
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								gen/tr/nl.po
									
										
									
									
									
								
							| 
						 | 
					@ -163,18 +163,6 @@ msgstr "Vul een reële waarde in."
 | 
				
			||||||
msgid "bad_date"
 | 
					msgid "bad_date"
 | 
				
			||||||
msgstr ""
 | 
					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."
 | 
					#. Default: "The value is not among possible values for this field."
 | 
				
			||||||
msgid "bad_select_value"
 | 
					msgid "bad_select_value"
 | 
				
			||||||
msgstr "Deze waarde wordt niet geaccepteerd voor dit veld."
 | 
					msgstr "Deze waarde wordt niet geaccepteerd voor dit veld."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue