当前位置: 首页>>代码示例>>Python>>正文


Python Widget.__init__方法代码示例

本文整理汇总了Python中calibre.gui2.convert.Widget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Widget.__init__方法的具体用法?Python Widget.__init__怎么用?Python Widget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在calibre.gui2.convert.Widget的用法示例。


在下文中一共展示了Widget.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent, [
            'override_profile_size', 'paper_size', 'custom_size',
            'preserve_cover_aspect_ratio', 'pdf_serif_family', 'unit',
            'pdf_sans_family', 'pdf_mono_family', 'pdf_standard_font',
            'pdf_default_font_size', 'pdf_mono_font_size', 'pdf_page_numbers',
            'pdf_footer_template', 'pdf_header_template', 'pdf_add_toc', 'toc_title',
        ])
        self.db, self.book_id = db, book_id
        try:
            self.hf_label.setText(self.hf_label.text() % localize_user_manual_link(
                'https://manual.calibre-ebook.com/conversion.html#converting-to-pdf'))
        except TypeError:
            pass  # link already localized

        for x in get_option('paper_size').option.choices:
            self.opt_paper_size.addItem(x)
        for x in get_option('unit').option.choices:
            self.opt_unit.addItem(x)
        for x in get_option('pdf_standard_font').option.choices:
            self.opt_pdf_standard_font.addItem(x)

        self.initialize_options(get_option, get_help, db, book_id)
        self.layout().setFieldGrowthPolicy(self.layout().ExpandingFieldsGrow)
        self.template_box.layout().setFieldGrowthPolicy(self.layout().AllNonFixedFieldsGrow)
开发者ID:davidfor,项目名称:calibre,代码行数:27,代码来源:pdf_output.py

示例2: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent,
                ['enable_heuristics', 'markup_chapter_headings',
                 'italicize_common_cases', 'fix_indents',
                 'html_unwrap_factor', 'unwrap_lines',
                 'delete_blank_paragraphs',
                 'format_scene_breaks', 'replace_scene_breaks',
                 'dehyphenate', 'renumber_headings']
                )
        self.db, self.book_id = db, book_id
        self.rssb_defaults = [u'', u'<hr />', u'∗ ∗ ∗', u'• • •', u'♦ ♦ ♦',
                u'† †', u'‡ ‡ ‡', u'∞ ∞ ∞', u'¤ ¤ ¤', u'§']
        self.initialize_options(get_option, get_help, db, book_id)

        self.load_histories()

        self.opt_enable_heuristics.stateChanged.connect(self.enable_heuristics)
        self.opt_unwrap_lines.stateChanged.connect(self.enable_unwrap)

        self.enable_heuristics(self.opt_enable_heuristics.checkState())
        try:
            self.help_label.setText(self.help_label.text() % localize_user_manual_link(
                'https://manual.calibre-ebook.com/conversion.html#heuristic-processing'))
        except TypeError:
            pass  # link already localized
开发者ID:NathanaelA,项目名称:calibre,代码行数:27,代码来源:heuristics.py

示例3: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent,
                ['prefer_author_sort', 'toc_title',
                    'mobi_keep_original_images',
                    'mobi_ignore_margins', 'mobi_toc_at_start',
                'dont_compress', 'no_inline_toc', 'share_not_sync',
                'personal_doc', 'mobi_file_type']
                )
        self.db, self.book_id = db, book_id

        '''
        from calibre.utils.fonts import fontconfig

        global font_family_model
        if font_family_model is None:
            font_family_model = FontFamilyModel()
            try:
                font_family_model.families = fontconfig.find_font_families(allowed_extensions=['ttf'])
            except:
                import traceback
                font_family_model.families = []
                print 'WARNING: Could not load fonts'
                traceback.print_exc()
            font_family_model.families.sort()
            font_family_model.families[:0] = [_('Default')]

        self.font_family_model = font_family_model
        self.opt_masthead_font.setModel(self.font_family_model)
        '''
        self.opt_mobi_file_type.addItems(['old', 'both', 'new'])

        self.initialize_options(get_option, get_help, db, book_id)
开发者ID:yeyanchao,项目名称:calibre,代码行数:34,代码来源:mobi_output.py

示例4: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(
            self,
            parent,
            [
                "override_profile_size",
                "paper_size",
                "custom_size",
                "preserve_cover_aspect_ratio",
                "pdf_serif_family",
                "unit",
                "pdf_sans_family",
                "pdf_mono_family",
                "pdf_standard_font",
                "pdf_default_font_size",
                "pdf_mono_font_size",
                "pdf_page_numbers",
                "pdf_footer_template",
                "pdf_header_template",
                "pdf_add_toc",
                "toc_title",
            ],
        )
        self.db, self.book_id = db, book_id

        for x in get_option("paper_size").option.choices:
            self.opt_paper_size.addItem(x)
        for x in get_option("unit").option.choices:
            self.opt_unit.addItem(x)
        for x in get_option("pdf_standard_font").option.choices:
            self.opt_pdf_standard_font.addItem(x)

        self.initialize_options(get_option, get_help, db, book_id)
开发者ID:GaryMMugford,项目名称:calibre,代码行数:35,代码来源:pdf_output.py

示例5: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        self.__connections = []
        Widget.__init__(
            self,
            parent,
            ["margin_top", "margin_left", "margin_right", "margin_bottom", "input_profile", "output_profile"],
        )

        self.db, self.book_id = db, book_id
        self.input_model = ProfileModel(input_profiles())
        self.output_model = ProfileModel(output_profiles())
        self.opt_input_profile.setModel(self.input_model)
        self.opt_output_profile.setModel(self.output_model)
        for g, slot in self.__connections:
            g.selectionModel().currentChanged.connect(slot)
        del self.__connections

        for x in (self.opt_input_profile, self.opt_output_profile):
            x.setMouseTracking(True)
            self.connect(x, SIGNAL("entered(QModelIndex)"), self.show_desc)
        self.initialize_options(get_option, get_help, db, book_id)
        it = unicode(self.opt_input_profile.toolTip())
        self.opt_input_profile.setToolTip("<p>" + it.replace("t.", "t.\n<br>"))
        it = unicode(self.opt_output_profile.toolTip())
        self.opt_output_profile.setToolTip("<p>" + it.replace("t.", "ce.\n<br>"))
开发者ID:7u,项目名称:calibre,代码行数:27,代码来源:page_setup.py

示例6: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent, OPTIONS['output']['mobi'])
        self.db, self.book_id = db, book_id

        self.opt_mobi_file_type.addItems(['old', 'both', 'new'])

        self.initialize_options(get_option, get_help, db, book_id)
开发者ID:JimmXinu,项目名称:calibre,代码行数:9,代码来源:mobi_output.py

示例7: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
 def __init__(self, parent, get_option, get_help, db=None, book_id=None):
     Widget.__init__(self, parent,
             ['change_justification', 'extra_css', 'base_font_size',
                 'font_size_mapping', 'line_height', 'minimum_line_height',
                 'embed_font_family', 'embed_all_fonts', 'subset_embedded_fonts',
                 'smarten_punctuation', 'unsmarten_punctuation',
                 'disable_font_rescaling', 'insert_blank_line',
                 'remove_paragraph_spacing',
                 'remove_paragraph_spacing_indent_size',
                 'insert_blank_line_size',
                 'input_encoding', 'filter_css', 'expand_css',
                 'asciiize', 'keep_ligatures',
                 'linearize_tables']
             )
     for val, text in [
             ('original', _('Original')),
             ('left', _('Left align')),
             ('justify', _('Justify text'))
             ]:
         self.opt_change_justification.addItem(text, (val))
     self.db, self.book_id = db, book_id
     self.initialize_options(get_option, get_help, db, book_id)
     self.opt_disable_font_rescaling.toggle()
     self.opt_disable_font_rescaling.toggle()
     self.button_font_key.clicked.connect(self.font_key_wizard)
     self.opt_remove_paragraph_spacing.toggle()
     self.opt_remove_paragraph_spacing.toggle()
     self.opt_smarten_punctuation.stateChanged.connect(
             lambda state: state != Qt.Unchecked and
             self.opt_unsmarten_punctuation.setCheckState(Qt.Unchecked))
     self.opt_unsmarten_punctuation.stateChanged.connect(
             lambda state: state != Qt.Unchecked and
             self.opt_smarten_punctuation.setCheckState(Qt.Unchecked))
     self.opt_extra_css.size_hint = QSize(400, 300)
开发者ID:worr,项目名称:calibre,代码行数:36,代码来源:look_and_feel.py

示例8: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent, OPTIONS['output']['lrf'])
        self.db, self.book_id = db, book_id

        self.initialize_options(get_option, get_help, db, book_id)
        self.opt_header.toggle(), self.opt_header.toggle()
        self.opt_render_tables_as_images.toggle()
        self.opt_render_tables_as_images.toggle()
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:lrf_output.py

示例9: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent, OPTIONS['output']['pdb'])
        self.db, self.book_id = db, book_id

        for x in get_option('format').option.choices:
            self.opt_format.addItem(x)

        self.initialize_options(get_option, get_help, db, book_id)
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:pdb_output.py

示例10: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
 def __init__(self, parent, get_option, get_help, db=None, book_id=None):
     Widget.__init__(self, parent, OPTIONS['input']['comic'])
     self.db, self.book_id = db, book_id
     for x in get_option('output_format').option.choices:
         self.opt_output_format.addItem(x)
     self.initialize_options(get_option, get_help, db, book_id)
     self.opt_no_process.toggle()
     self.opt_no_process.toggle()
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:comic_input.py

示例11: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
 def __init__(self, parent, get_option, get_help, db=None, book_id=None):
     Widget.__init__(self, parent, OPTIONS['output']['txt'])
     self.db, self.book_id = db, book_id
     for x in get_option('newline').option.choices:
         self.opt_newline.addItem(x)
     for x in get_option('txt_output_formatting').option.choices:
         self.opt_txt_output_formatting.addItem(x)
     self.initialize_options(get_option, get_help, db, book_id)
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:txt_output.py

示例12: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
 def __init__(self, parent, get_option, get_help, db=None, book_id=None):
     Widget.__init__(self, parent, OPTIONS['output']['fb2'])
     self.db, self.book_id = db, book_id
     for x in ('toc', 'files', 'nothing'):
         self.opt_sectionize.addItem(x)
     for x in get_option('fb2_genre').option.choices:
         self.opt_fb2_genre.addItem(x)
     self.initialize_options(get_option, get_help, db, book_id)
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:fb2_output.py

示例13: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
 def __init__(self, parent, get_option, get_help, db=None, book_id=None):
     Widget.__init__(self, parent, OPTIONS['output']['epub'])
     for i in range(2):
         self.opt_no_svg_cover.toggle()
     ev = get_option('epub_version')
     self.opt_epub_version.addItems(list(ev.option.choices))
     self.db, self.book_id = db, book_id
     self.initialize_options(get_option, get_help, db, book_id)
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:epub_output.py

示例14: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
 def __init__(self, parent, get_option, get_help, db=None, book_id=None):
     Widget.__init__(self, parent, OPTIONS['output']['htmlz'])
     self.db, self.book_id = db, book_id
     for x in get_option('htmlz_css_type').option.choices:
         self.opt_htmlz_css_type.addItem(x)
     for x in get_option('htmlz_class_style').option.choices:
         self.opt_htmlz_class_style.addItem(x)
     self.initialize_options(get_option, get_help, db, book_id)
开发者ID:JimmXinu,项目名称:calibre,代码行数:10,代码来源:htmlz_output.py

示例15: __init__

# 需要导入模块: from calibre.gui2.convert import Widget [as 别名]
# 或者: from calibre.gui2.convert.Widget import __init__ [as 别名]
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        Widget.__init__(self, parent, ['format', 'inline_toc', 'pdb_output_encoding'])
        self.db, self.book_id = db, book_id

        for x in get_option('format').option.choices:
            self.opt_format.addItem(x)

        self.initialize_options(get_option, get_help, db, book_id)
开发者ID:davidfor,项目名称:calibre,代码行数:10,代码来源:pdb_output.py


注:本文中的calibre.gui2.convert.Widget.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。