import logging
logging.basicConfig(level=logging.ERROR,
                    format='%(asctime)s %(levelname)s \t (%(module)s:%(lineno)d) %(message)s ',
                    #filename='vanHelsing.log',
                    filemode='w')

import copy


import nosferatu.bacresources as bacresources

configstring = open('regression/bacula-dir-devel.conf').read()
print "configstring read"
DirConf = bacresources.DirectorConfig(configstring)
print "Dirconf created"
fileset = DirConf.getResourceByName('TestSet')

include = fileset.getResourcesListByResType('include')[0]
print include
files = include.getItemsListByItemName('file')
print files
files[1].setValue('/NewFile')

#newfile = copy.deepcopy(files[0])
#newfile.setValue('/NewFile2')
#include.items.append(newfile)

print fileset
