Commit bdf119a9 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

implementation of converters finished

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4359
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent d7e46991
......@@ -116,6 +116,7 @@ class Converter():
def __init__(self, sectionDict):
self.sectionDict = sectionDict
self.line = ''
self.addCronExpr = True
def covert(self)
"""
......@@ -153,7 +154,9 @@ class TestConverter(Converter):
Class which implements a test section dictionary converter
"""
def convertDict(self):
self.line = self.sectionDict['cronexpr']+' csbackchk'
if self.addCronExpr:
self.line = self.sectionDict['cronexpr']+' '
self.line += 'csbackchk'
if self.sectionDict['logging']:
self.line += ' -l'
if not self.sectionDict['recursive']:
......@@ -172,10 +175,10 @@ class BackupConverter(Converter):
Class which implements a backup section dictionary converter
"""
def convertDict(self):
line = self.sectionDict['cronexpr']+' rsync -aq'
self.line = self.sectionDict['cronexpr']+' rsync -aq'
for regex in self.sectionDict['exclude']
line += " --exclude='"+regex+"'"
line += self.sectionDict['srcdir']+' '+self.sectionDict['targetdir']+ \
self.line += " --exclude='"+regex+"'"
self.line += self.sectionDict['srcdir']+' '+self.sectionDict['targetdir']+ \
'; csbackgen'
if self.sectionDict['logging']:
self.line += ' -l'
......@@ -184,11 +187,21 @@ class BackupConverter(Converter):
if self.sectionDict['followlinks']:
self.line += ' -f'
for regex in self.sectionDict['exclude']
line += " -e '"+regex+"'
line += ' -t '+self.sectionDict['targetdir']+' '+self.sectionDict['srcdir']
self.line += " -e '"+regex+"'
self.line += ' -t '+self.sectionDict['targetdir']+' '+ \
self.sectionDict['srcdir']
if self.sectionDict['test']:
# keep on going here
testConv = TestConverter()
testConv = TestConverter({'cronexpr:' self.sectionDict['cronexpr'], \
'srcdir': self.sectionDict['targetdir'], \
'dir': self.sectionDict['targetdir'], \
'exclude': self.sectionDict['exclude'], \
'recursive': self.sectionDict['recursive'], \
'logging': self.sectionDict['logging'], \
'followlinks': self.sectionDict['followlinks'], \
'tolerant': self.sectionDict['tolerant']})
testConv.addCronExpr = False
testConv.convert()
self.line += ' '+str(testConv)
# -----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment