def filepath(self, basedir=None, dirname=None, filename=None, filetype=None, create_dir=False): if basedir == None: basedir = self.conf['basedir'] if dirname == None: dirname = self.conf['dirname'] if filename == None: filename = self.conf['filename'] if filetype == None: filetype = self.conf['filetype'] dirname = self.datetime.strftime(dirname) filename = self.datetime.strftime(filename) path = basedir + '/' + dirname if create_dir: tools.dir(path) self.file = path + '/' + filename + '.' + filetype return self.file
def dir_init(self): tools.dir(self.conf['basedir'])