- Timestamp:
- Oct 22, 2019, 2:30:49 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/svn_backup.py
r40952 r40962 1 import argparse2 1 import os.path as path 3 2 4 import backups.utils.config_parse_helper as cfg_help 5 from backup s.backupimport Backup6 from backups.utils.config_parse_helper import ConfigSchema, ConfigSchemaSection, ConfigSchemaLine3 from utils.config_parse_helper import SpecialSchemaProcessing 4 from backup import Backup 5 from utils.config_parse_helper import ConfigSchema, ConfigSchemaSection, ConfigSchemaLine 7 6 8 7 EXPECTED_CONFIG_FILE = path.join(path.dirname(__file__), './svn_backup.config') … … 11 10 [ ConfigSchemaSection('DEFAULT', 12 11 [ ConfigSchemaLine('backup_paths', True, list, 13 cfg_help.SpecialSchemaProcessing.commma_separated)12 SpecialSchemaProcessing.commma_separated) 14 13 , ConfigSchemaLine('source_machine', True, str) 15 14 , ConfigSchemaLine('verbose', False, bool) … … 18 17 , ConfigSchemaSection('COPY', 19 18 [ ConfigSchemaLine('sources', True, list, 20 cfg_help.SpecialSchemaProcessing.commma_separated)19 SpecialSchemaProcessing.commma_separated) 21 20 , ConfigSchemaLine('additional_args', False, list, 22 cfg_help.SpecialSchemaProcessing.space_separated)21 SpecialSchemaProcessing.space_separated) 23 22 ]) 24 23 , ConfigSchemaSection('RSYNC', 25 24 [ ConfigSchemaLine('sources', True, list, 26 cfg_help.SpecialSchemaProcessing.commma_separated)25 SpecialSchemaProcessing.commma_separated) 27 26 , ConfigSchemaLine('additional_args', False, list, 28 cfg_help.SpecialSchemaProcessing.space_separated)27 SpecialSchemaProcessing.space_separated) 29 28 ]) 30 29 ] … … 38 37 39 38 40 def main(): 41 sb = SvnBackup() 42 sb.run_backup() 43 44 45 def parse_args(args): 46 47 parser = argparse.ArgumentParser( 48 description='Performs backup of svn.') 49 50 parser.add_argument('--config_file', 51 nargs='?', 52 help='specify the location of a config that matches the ConfigSchema', 53 default=EXPECTED_CONFIG_FILE) 54 55 return parser.parse_args() 39 def main(config=EXPECTED_CONFIG_FILE, schema=SVN_SCHEMA): 40 sb = SvnBackup(config, schema) 41 sb.run_backup_processes() 56 42 57 43
Note:
See TracChangeset
for help on using the changeset viewer.
