def test_get_config(self):
        with tempfile.TemporaryDirectory() as dname:
            print(dname)  # /tmp/tmpl2cvqpq5
            test_yaml = os.path.join(dname, "test.yaml")
            with open(test_yaml, "w") as f:
                yaml.dump(self.sample_config(), f)

                conf = SettingsManager()
                conf.load(test_yaml)
                assert conf.input_file_path == 'input'
                assert conf.template_file_path == 'template'
                assert conf.save_directory == 'save'
                assert conf.save_file_name == 'file'
예제 #2
0
def main():
    config_file_path = os.path.join(os.path.dirname(sys.argv[0]), "config.yaml")
    conf = SettingsManager()
    conf.load(config_file_path)

    target = open(conf.target_file_path, "rb")
    reader = PyPDF2.PdfFileReader(target)
    writer = PyPDF2.PdfFileWriter()

    print("対象PDF:{0}".format(conf.target_file_path))
    print("出力ファイルパス:{0}".format(conf.out_file_path))
    print("回転角度:{0}度".format(conf.rotate))
    for page in range(reader.numPages):
        obj = reader.getPage(page)
        obj.rotateClockwise(conf.rotate)  # 回転させる
        writer.addPage(obj)

    outfile = open(conf.out_file_path, "wb")
    writer.write(outfile)
    outfile.close()
    target.close()
예제 #3
0
def main():
    config_file_path = os.path.join(os.path.dirname(__file__), 'config.yaml')
    conf = SettingsManager()
    conf.load(config_file_path)
    report_instance = ReportInsured(conf)
    report_instance.generate()
예제 #4
0
    def load_ui_info(self):
        settings = SettingsManager(CONFIG_FILE)
        settings.load(self.ui.root_dir_edit)
        settings.load(self.ui.title_edit)
        settings.load(self.ui.description_edit)
        settings.load(self.ui.command_option_edit)
        settings.load(self.ui.can_device_edit)
        settings.load(self.ui.candump_checkbox)

        # Set default value
        if self.ui.can_device_edit.text() == '':
            self.ui.can_device_edit.setText('can0')

        self.ui.candump_checkbox.setEnabled(self.found_candump)
예제 #5
0
 def load_ui_info(self):
     settings = SettingsManager(CONFIG_FILE)
     settings.load(self.ui.save_path_edit)
예제 #6
0
 def load_ui_info(self):
     settings = SettingsManager(CONFIG_FILE)
     settings.load(self.ui.load_path_edit)
     settings.load(self.ui.override_velocity_edit)