def __init__(self, builder, config, source_filename, prepare=False): self.builder = builder self.config = config self.title = 'Untitled' self.summary = None self.pub_date = None self.source_filename = source_filename self.links = [] self.program_name = self.config.get('program') if self.program_name is None: self.program_name = self.builder.guess_program( config, source_filename) self.program = self.builder.programs[self.program_name](self) self.destination_filename = self.program.get_desired_filename() if prepare: self.program.prepare() after_file_prepared.send(self)
def __init__(self, builder, config, source_filename, prepare=False): self.builder = builder self.config = config self.title = 'Untitled' self.summary = None self.pub_date = None self.source_filename = source_filename self.links = [] self.program_name = self.config.get('program') if self.program_name is None: self.program_name = self.builder.guess_program( config, source_filename) self.program = self.builder.programs[self.program_name](self) self.destination_filename = self.program.get_desired_filename() if prepare: self.program.prepare() after_file_prepared.send(self) if self.public: after_file_published.send(self)
def __init__(self, builder, config, source_filename, prepare=False): self.builder = builder self.config = config self.title = "Untitled" self.summary = None self.pub_date = None self.source_filename = source_filename self.links = [] self.program_name = self.config.get("program") if self.program_name is None: self.program_name = self.builder.guess_program(config, source_filename) self.program = self.builder.programs[self.program_name](self) self.destination_filename = os.path.join( self.builder.prefix_path.lstrip("/"), self.program.get_desired_filename() ) if prepare: self.program.prepare() after_file_prepared.send(self) if self.public: after_file_published.send(self)