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


Python GlobalSettings.addConfigOption方法代码示例

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


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

示例1: _create_default_config

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
    def _create_default_config(self, child_name):
        """Creates default settings to save the state of a detachable widget."""
        try:
            GlobalSettings.addConfigSection(child_name)
        except ConfigError:
            self.info("Section %s already exists", child_name)
            return

        GlobalSettings.addConfigOption(child_name + "docked",
                                       section=child_name,
                                       key="docked",
                                       default=True)
        GlobalSettings.addConfigOption(child_name + "width",
                                       section=child_name,
                                       key="width",
                                       default=320)
        GlobalSettings.addConfigOption(child_name + "height",
                                       section=child_name,
                                       key="height",
                                       default=400)
        GlobalSettings.addConfigOption(child_name + "x",
                                       section=child_name,
                                       key="x",
                                       default=0)
        GlobalSettings.addConfigOption(child_name + "y",
                                       section=child_name,
                                       key="y",
                                       default=0)

        GlobalSettings.readSettingSectionFromFile(self.settings, child_name)
开发者ID:GNOME,项目名称:pitivi,代码行数:32,代码来源:tabsmanager.py

示例2: _createDefaultConfig

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
    def _createDefaultConfig(self, child_name):
        """
        If they do not exist already, create default settings
        to save the state of a detachable widget.
        """
        GlobalSettings.addConfigSection(child_name)
        GlobalSettings.addConfigOption(child_name + "docked",
            section=child_name,
            key="docked",
            default=True)
        GlobalSettings.addConfigOption(child_name + "width",
            section=child_name,
            key="width",
            default=320)
        GlobalSettings.addConfigOption(child_name + "height",
            section=child_name,
            key="height",
            default=400)
        GlobalSettings.addConfigOption(child_name + "x",
            section=child_name,
            key="x",
            default=0)
        GlobalSettings.addConfigOption(child_name + "y",
            section=child_name,
            key="y",
            default=0)

        GlobalSettings.readSettingSectionFromFile(self.settings, child_name)
开发者ID:dark-al,项目名称:pitivi,代码行数:30,代码来源:tabsmanager.py

示例3: test_write_config_file

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
    def test_write_config_file(self):
        GlobalSettings.addConfigSection("section-new")
        GlobalSettings.addConfigOption("sectionNewOptionA",
                                       section="section-new", key="option-a",
                                       default="elmo")

        with mock.patch("pitivi.settings.xdg_config_home") as xdg_config_home,\
                tempfile.TemporaryDirectory() as temp_dir:
            xdg_config_home.return_value = temp_dir
            settings1 = GlobalSettings()

            settings1.sectionNewOptionA = "kermit"
            settings1.storeSettings()

            settings2 = GlobalSettings()
            self.assertEqual(settings2.sectionNewOptionA, "kermit")
开发者ID:cfoch,项目名称:pitivi,代码行数:18,代码来源:test_settings.py

示例4: test_read_config_file

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
    def test_read_config_file(self):
        GlobalSettings.addConfigSection("section-1")
        GlobalSettings.addConfigOption("section1OptionA", section="section-1",
                                       key="option-a", default=50)
        GlobalSettings.addConfigOption("section1OptionB", section="section-1",
                                       key="option-b", default=False)
        GlobalSettings.addConfigOption("section1OptionC", section="section-1",
                                       key="option-c", default="")

        self.assertEqual(GlobalSettings.section1OptionA, 50)
        self.assertEqual(GlobalSettings.section1OptionB, False)
        self.assertEqual(GlobalSettings.section1OptionC, "")

        conf_file_content = ("[section-1]\n"
                             "option-a = 10\n"
                             "option-b = True\n"
                             "option-c = Pigs fly\n")

        with mock.patch("pitivi.settings.xdg_config_home") as xdg_config_home,\
                tempfile.TemporaryDirectory() as temp_dir:
            with open(os.path.join(temp_dir, "pitivi.conf"), "w") as tmp_file:
                tmp_file.write(conf_file_content)
            xdg_config_home.return_value = temp_dir
            settings = GlobalSettings()

        self.assertEqual(settings.section1OptionA, 10)
        self.assertEqual(settings.section1OptionB, True)
        self.assertEqual(settings.section1OptionC, "Pigs fly")
开发者ID:cfoch,项目名称:pitivi,代码行数:30,代码来源:test_settings.py

示例5:

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from gi.repository import Gio
from gi.repository import Gtk

from pitivi.configure import get_pixmap_dir
from pitivi.dialogs.about import AboutDialog
from pitivi.dialogs.prefs import PreferencesDialog
from pitivi.editorperspective import EditorPerspective
from pitivi.greeterperspective import GreeterPerspective
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.misc import show_user_manual


GlobalSettings.addConfigOption('mainWindowX',
                               section="main-window",
                               key="X", default=0, type_=int)
GlobalSettings.addConfigOption('mainWindowY',
                               section="main-window",
                               key="Y", default=0, type_=int)
GlobalSettings.addConfigOption('mainWindowWidth',
                               section="main-window",
                               key="width", default=-1, type_=int)
GlobalSettings.addConfigOption('mainWindowHeight',
                               section="main-window",
                               key="height", default=-1, type_=int)

GlobalSettings.addConfigSection('export')
GlobalSettings.addConfigOption('lastExportFolder',
                               section='export',
                               key="last-export-folder",
开发者ID:GNOME,项目名称:pitivi,代码行数:32,代码来源:mainwindow.py

示例6:

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from pitivi.dialogs.filelisterrordialog import FileListErrorDialog
from pitivi.mediafilespreviewer import PreviewWidget
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.misc import PathWalker, quote_uri, path_from_uri
from pitivi.utils.ui import beautify_info, beautify_length, info_name, \
    URI_TARGET_ENTRY, FILE_TARGET_ENTRY, SPACING

# Values used in the settings file.
SHOW_TREEVIEW = 1
SHOW_ICONVIEW = 2

GlobalSettings.addConfigSection('clip-library')
GlobalSettings.addConfigOption('lastImportFolder',
                               section='clip-library',
                               key='last-folder',
                               environment='PITIVI_IMPORT_FOLDER',
                               default=os.path.expanduser("~"))
GlobalSettings.addConfigOption('closeImportDialog',
                               section='clip-library',
                               key='close-import-dialog-after-import',
                               default=True)
GlobalSettings.addConfigOption('lastClipView',
                               section='clip-library',
                               key='last-clip-view',
                               type_=int,
                               default=SHOW_ICONVIEW)

STORE_MODEL_STRUCTURE = (
    GdkPixbuf.Pixbuf, GdkPixbuf.Pixbuf,
    str, object, str, str, str)
开发者ID:davlem,项目名称:pitivi,代码行数:33,代码来源:medialibrary.py

示例7: in

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from pitivi.ui.sourcelist import SourceList
from pitivi.ui.effectlist import EffectList
from pitivi.ui.clipproperties import ClipProperties
from pitivi.ui.common import beautify_factory
from pitivi.utils import beautify_length
from pitivi.ui.zoominterface import Zoomable
from pitivi.ui.startupwizard import StartUpWizard

if HAVE_GCONF:
    D_G_INTERFACE = "/desktop/gnome/interface"

    for gconf_dir in (D_G_INTERFACE, ):
        gconf.client_get_default ().add_dir (gconf_dir, gconf.CLIENT_PRELOAD_NONE)

GlobalSettings.addConfigOption("fileSupportEnabled",
    environment="PITIVI_FILE_SUPPORT",
    default=False)

GlobalSettings.addConfigSection("main-window")
GlobalSettings.addConfigOption('mainWindowFullScreen',
    section="main-window",
    key="full-screen",
    default=False)
GlobalSettings.addConfigOption('mainWindowHPanePosition',
    section="main-window",
    key="hpane-position",
    type_=int)
GlobalSettings.addConfigOption('mainWindowMainHPanePosition',
    section="main-window",
    key="main-hpane-position",
    type_=int)
开发者ID:emdash,项目名称:pitivi,代码行数:33,代码来源:mainwindow.py

示例8: PreviewerBin

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
THUMB_MARGIN_PX = 3
# For the waveforms, ensures we always have a little extra surface when
# scrolling while playing.
MARGIN = 500

PREVIEW_GENERATOR_SIGNALS = {
    "done": (GObject.SIGNAL_RUN_LAST, None, ()),
    "error": (GObject.SIGNAL_RUN_LAST, None, ()),
}

THUMB_HEIGHT = EXPANDED_SIZE - 2 * THUMB_MARGIN_PX

GlobalSettings.addConfigSection("previewers")

GlobalSettings.addConfigOption("previewers_max_cpu",
                               section="previewers",
                               key="max-cpu-usage",
                               default=90)


class PreviewerBin(Gst.Bin, Loggable):
    """Baseclass for elements gathering datas to create previews."""
    def __init__(self, bin_desc):
        Gst.Bin.__init__(self)
        Loggable.__init__(self)

        self.internal_bin = Gst.parse_bin_from_description(bin_desc, True)
        self.add(self.internal_bin)
        self.add_pad(Gst.GhostPad.new(None, self.internal_bin.sinkpads[0]))
        self.add_pad(Gst.GhostPad.new(None, self.internal_bin.srcpads[0]))

    def finalize(self, proxy=None):
开发者ID:jubayed,项目名称:pitivi,代码行数:34,代码来源:previewers.py

示例9: PlayheadController

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from pitivi.ui.zoominterface import Zoomable
from pitivi.settings import GlobalSettings
from pitivi.ui.prefs import PreferencesDialog
from pitivi.ui.common import TRACK_SPACING, unpack_cairo_pattern, \
        LAYER_HEIGHT_EXPANDED, LAYER_SPACING
from pitivi.ui.controller import Controller
from pitivi.ui.curve import KW_LABEL_Y_OVERFLOW

# cursors to be used for resizing objects
ARROW = gtk.gdk.Cursor(gtk.gdk.ARROW)
# TODO: replace this with custom cursor
PLAYHEAD_CURSOR = gtk.gdk.Cursor(gtk.gdk.SB_H_DOUBLE_ARROW)

GlobalSettings.addConfigOption('edgeSnapDeadband',
    section = "user-interface",
    key = "edge-snap-deadband",
    default = 5,
    notify = True)

PreferencesDialog.addNumericPreference('edgeSnapDeadband',
    section = _("Behavior"),
    label = _("Snap Distance (pixels)"),
    description = _("Threshold distance (in pixels) used for all snapping "
        "operations"),
    lower = 0)

class PlayheadController(Controller, Zoomable):

    _cursor = PLAYHEAD_CURSOR

开发者ID:Zarmakuizz,项目名称:Pitivi,代码行数:31,代码来源:timelinecanvas.py

示例10:

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
#                       Private stuff                          #
LEFT_SIDE = Gdk.Cursor.new(Gdk.CursorType.LEFT_SIDE)
RIGHT_SIDE = Gdk.Cursor.new(Gdk.CursorType.RIGHT_SIDE)
ARROW = Gdk.Cursor.new(Gdk.CursorType.ARROW)
TRIMBAR_PIXBUF = GdkPixbuf.Pixbuf.new_from_file(
    os.path.join(configure.get_pixmap_dir(), "trimbar-normal.png"))
TRIMBAR_PIXBUF_FOCUS = GdkPixbuf.Pixbuf.new_from_file(
    os.path.join(configure.get_pixmap_dir(), "trimbar-focused.png"))
NAME_HOFFSET = 10
NAME_VOFFSET = 5
NAME_PADDING = 2
NAME_PADDING2X = 2 * NAME_PADDING

GlobalSettings.addConfigOption('videoClipBg',
    section='user-interface',
    key='videoclip-background',
    default=993737707,
    notify=True)

PreferencesDialog.addColorPreference('videoClipBg',
    section=_("Appearance"),
    label=_("Color for video clips"),
    description=_("The background color for clips in video tracks."))

GlobalSettings.addConfigOption('audioClipBg',
    section='user-interface',
    key='audioclip-background',
    default=996806336,
    notify=True)

PreferencesDialog.addColorPreference('audioClipBg',
开发者ID:luisbg,项目名称:PiTiVi,代码行数:33,代码来源:track.py

示例11: range

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from pitivi.signalgroup import SignalGroup
from pitivi.stream import VideoStream, AudioStream, TextStream, MultimediaStream
from pitivi.settings import GlobalSettings
from pitivi.utils import beautify_length
from pitivi.ui.common import beautify_factory, factory_name, beautify_stream, PADDING
from pitivi.log.loggable import Loggable
from pitivi.sourcelist import SourceListError

SHOW_TREEVIEW = 1
SHOW_ICONVIEW = 2

GlobalSettings.addConfigSection("clip-library")
GlobalSettings.addConfigOption(
    "lastImportFolder",
    section="clip-library",
    key="last-folder",
    environment="PITIVI_IMPORT_FOLDER",
    default=os.path.expanduser("~"),
)
GlobalSettings.addConfigOption(
    "closeImportDialog", section="clip-library", key="close-import-dialog-after-import", default=True
)
GlobalSettings.addConfigOption(
    "lastClipView", section="clip-library", key="last-clip-view", type_=int, default=SHOW_ICONVIEW
)

(COL_ICON, COL_ICON_LARGE, COL_INFOTEXT, COL_FACTORY, COL_URI, COL_LENGTH, COL_SEARCH_TEXT, COL_SHORT_TEXT) = range(8)

ui = """
<ui>
    <menubar name="MainMenuBar">
开发者ID:emdash,项目名称:pitivi,代码行数:33,代码来源:sourcelist.py

示例12: createEncodingProfileSimple

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable

# Make sure gst knowns about our own GstPresets
Gst.preset_set_app_dir(get_gstpresets_dir())


class ProxyingStrategy:
    AUTOMATIC = "automatic"
    ALL = "all"
    NOTHING = "nothing"


GlobalSettings.addConfigSection("proxy")
GlobalSettings.addConfigOption(
    "proxyingStrategy", section="proxy", key="proxying-strategy", default=ProxyingStrategy.AUTOMATIC
)
GlobalSettings.addConfigOption("numTranscodingJobs", section="proxy", key="num-proxying-jobs", default=4)


ENCODING_FORMAT_PRORES = "prores-opus-in-matroska.gep"
ENCODING_FORMAT_JPEG = "jpeg-opus-in-matroska.gep"


def createEncodingProfileSimple(container_caps, audio_caps, video_caps):
    c = GstPbutils.EncodingContainerProfile.new(None, None, Gst.Caps(container_caps), None)
    a = GstPbutils.EncodingAudioProfile.new(Gst.Caps(audio_caps), None, None, 0)
    v = GstPbutils.EncodingVideoProfile.new(Gst.Caps(video_caps), None, None, 0)

    c.add_profile(a)
    c.add_profile(v)
开发者ID:,项目名称:,代码行数:33,代码来源:

示例13:

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable

# Make sure gst knowns about our own GstPresets
Gst.preset_set_app_dir(get_gstpresets_dir())


class ProxyingStrategy:
    AUTOMATIC = "automatic"
    ALL = "all"
    NOTHING = "nothing"


GlobalSettings.addConfigSection("proxy")
GlobalSettings.addConfigOption('proxyingStrategy',
                               section='proxy',
                               key='proxying-strategy',
                               default=ProxyingStrategy.AUTOMATIC)
GlobalSettings.addConfigOption('numTranscodingJobs',
                               section='proxy',
                               key='num-proxying-jobs',
                               default=4)
GlobalSettings.addConfigOption("max_cpu_usage",
                               section="proxy",
                               key="max-cpu-usage",
                               default=10)


ENCODING_FORMAT_PRORES = "prores-raw-in-matroska.gep"
ENCODING_FORMAT_JPEG = "jpeg-raw-in-matroska.gep"

开发者ID:pitivi,项目名称:pitivi,代码行数:32,代码来源:proxy.py

示例14: API

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
import os
from enum import IntEnum
from gettext import gettext as _

from gi.repository import GObject
from gi.repository import Peas

from pitivi.configure import get_plugins_dir
from pitivi.configure import get_user_plugins_dir
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable


GlobalSettings.addConfigSection("plugins")
GlobalSettings.addConfigOption("ActivePlugins",
                               section="plugins", key="active-plugins",
                               default=[])


class API(GObject.GObject):
    """Interface that gives access to all the objects inside Pitivi."""

    def __init__(self, app):
        GObject.GObject.__init__(self)
        self.app = app


class PluginType(IntEnum):
    SYSTEM = 1
    USER = 2
开发者ID:jubayed,项目名称:pitivi,代码行数:32,代码来源:pluginmanager.py

示例15:

# 需要导入模块: from pitivi.settings import GlobalSettings [as 别名]
# 或者: from pitivi.settings.GlobalSettings import addConfigOption [as 别名]
from gettext import gettext as _

from pitivi.action import ViewAction

from pitivi.stream import VideoStream
from pitivi.utils import time_to_string, Seeker
from pitivi.log.loggable import Loggable
from pitivi.pipeline import PipelineError
from pitivi.ui.common import SPACING
from pitivi.settings import GlobalSettings
from pitivi.ui.dynamic import TimeWidget

GlobalSettings.addConfigSection("viewer")
GlobalSettings.addConfigOption("viewerDocked",
    section="viewer",
    key="docked",
    default=True)
GlobalSettings.addConfigOption("viewerWidth",
    section="viewer",
    key="width",
    default=320)
GlobalSettings.addConfigOption("viewerHeight",
    section="viewer",
    key="height",
    default=240)
GlobalSettings.addConfigOption("viewerX",
    section="viewer",
    key="x-pos",
    default=0)
GlobalSettings.addConfigOption("viewerY",
    section="viewer",
开发者ID:dparker18,项目名称:Pitivi,代码行数:33,代码来源:viewer.py


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