• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python conf._函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中meld.conf._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: __init__

 def __init__(self):
     GObject.GObject.__init__(self)
     self.scheduler = task.FifoScheduler()
     self.num_panes = 0
     self.label_text = _("untitled")
     self.tooltip_text = _("untitled")
     self.main_actiongroup = None
开发者ID:thics,项目名称:meld,代码行数:7,代码来源:melddoc.py


示例2: populate_vcs_for_location

    def populate_vcs_for_location(self, location):
        """Display VC plugin(s) that can handle the location"""
        vcs_model = self.combobox_vcs.get_model()
        vcs_model.clear()

        # VC systems can be executed at the directory level, so make sure
        # we're checking for VC support there instead of
        # on a specific file or on deleted/unexisting path inside vc
        location = os.path.abspath(location or ".")
        while not os.path.isdir(location):
            parent_location = os.path.dirname(location)
            if len(parent_location) >= len(location):
                # no existing parent: for example unexisting drive on Windows
                break
            location = parent_location
        else:
            # existing parent directory was found
            for avc in get_vcs(location):
                err_str = ''
                vc_details = {'name': avc.NAME, 'cmd': avc.CMD}

                if not avc.is_installed():
                    # Translators: This error message is shown when a version
                    # control binary isn't installed.
                    err_str = _("%(name)s (%(cmd)s not installed)")
                elif not avc.valid_repo(location):
                    # Translators: This error message is shown when a version
                    # controlled repository is invalid.
                    err_str = _("%(name)s (Invalid repository)")

                if err_str:
                    vcs_model.append([err_str % vc_details, avc, False])
                    continue

                vcs_model.append([avc.NAME, avc(location), True])

        valid_vcs = [(i, r[1].NAME) for i, r in enumerate(vcs_model) if r[2]]
        default_active = min(valid_vcs)[0] if valid_vcs else 0

        # Keep the same VC plugin active on refresh, otherwise use the first
        current_vc_name = self.vc.NAME if self.vc else None
        same_vc = [i for i, name in valid_vcs if name == current_vc_name]
        if same_vc:
            default_active = same_vc[0]

        if not valid_vcs:
            # If we didn't get any valid vcs then fallback to null
            null_vcs = _null.Vc(location)
            vcs_model.insert(0, [null_vcs.NAME, null_vcs, True])
            tooltip = _("No valid version control system found in this folder")
        elif len(vcs_model) == 1:
            tooltip = _("Only one version control system found in this folder")
        else:
            tooltip = _("Choose which version control system to use")

        self.combobox_vcs.set_tooltip_text(tooltip)
        self.combobox_vcs.set_sensitive(len(vcs_model) > 1)
        self.combobox_vcs.set_active(default_active)
开发者ID:jiapei100,项目名称:meld,代码行数:58,代码来源:vcview.py


示例3: _search_recursively_iter

    def _search_recursively_iter(self, iterstart):
        rootname = self.model.value_path(iterstart, 0)
        prefixlen = len(self.location) + 1
        symlinks_followed = set()
        todo = [(self.model.get_path(iterstart), rootname)]

        flattened = self.actiongroup.get_action("VcFlatten").get_active()
        active_action = lambda a: self.actiongroup.get_action(a).get_active()
        filters = [a[1] for a in self.state_actions.values() if
                   active_action(a[0]) and a[1]]

        yield _("Scanning %s") % rootname
        self.vc.cache_inventory(rootname)
        while todo:
            # This needs to happen sorted and depth-first in order for our row
            # references to remain valid while we traverse.
            todo.sort()
            treepath, path = todo.pop(0)
            it = self.model.get_iter(treepath)
            yield _("Scanning %s") % path[prefixlen:]

            entries = self.vc.listdir(path)
            entries = [e for e in entries if any(f(e) for f in filters)]
            for e in entries:
                if e.isdir:
                    try:
                        st = os.lstat(e.path)
                    # Covers certain unreadable symlink cases; see bgo#585895
                    except OSError as err:
                        error_string = "%s: %s" % (e.path, err.strerror)
                        self.model.add_error(it, error_string, 0)
                        continue

                    if stat.S_ISLNK(st.st_mode):
                        key = (st.st_dev, st.st_ino)
                        if key in symlinks_followed:
                            continue
                        symlinks_followed.add(key)

                    if flattened:
                        if e.state != tree.STATE_IGNORED:
                            todo.append((Gtk.TreePath.new_first(), e.path))
                        continue

                child = self.model.add_entries(it, [e.path])
                if e.isdir and e.state != tree.STATE_IGNORED:
                    todo.append((self.model.get_path(child), e.path))
                self._update_item_state(child, e, path[prefixlen:])

            if flattened:
                root = Gtk.TreePath.new_first()
                self.treeview.expand_row(Gtk.TreePath(root), False)
            else:
                if not entries:
                    self.model.add_empty(it, _("(Empty)"))
                if any(e.state != tree.STATE_NORMAL for e in entries):
                    self.treeview.expand_to_path(treepath)
开发者ID:ahart241,项目名称:meld,代码行数:57,代码来源:vcview.py


示例4: recompute_label

 def recompute_label(self):
     location = self.location
     if isinstance(location, str):
         location = location.decode(
             sys.getfilesystemencoding(), 'replace')
     self.label_text = os.path.basename(location)
     # TRANSLATORS: This is the location of the directory the user is diffing
     self.tooltip_text = _("%s: %s") % (_("Location"), location)
     self.label_changed()
开发者ID:fy2,项目名称:meld,代码行数:9,代码来源:vcview.py


示例5: file_saved_cb

 def file_saved_cb(self, saver, result, *args):
     gfile = saver.get_location()
     try:
         saver.save_finish(result)
     except GLib.Error as err:
         filename = GLib.markup_escape_text(gfile.get_parse_name())
         error_dialog(
             primary=_("Could not save file %s.") % filename,
             secondary=_("Couldn’t save file due to:\n%s") % (
                 GLib.markup_escape_text(str(err))),
         )
开发者ID:GNOME,项目名称:meld,代码行数:11,代码来源:patchdialog.py


示例6: populate_vcs_for_location

    def populate_vcs_for_location(self, location):
        """Display VC plugin(s) that can handle the location"""
        vcs_model = self.combobox_vcs.get_model()
        vcs_model.clear()

        # VC systems can be executed at the directory level, so make sure
        # we're checking for VC support there instead of
        # on a specific file or on deleted/unexisting path inside vc
        location = os.path.abspath(location or ".")
        while not os.path.isdir(location):
            parent_location = os.path.dirname(location)
            if len(parent_location) >= len(location):
                # no existing parent: for example unexisting drive on Windows
                break
            location = parent_location
        else:
            # existing parent directory was found
            for avc, enabled in get_vcs(location):
                err_str = ''
                vc_details = {'name': avc.NAME, 'cmd': avc.CMD}

                if not enabled:
                    # Translators: This error message is shown when no
                    # repository of this type is found.
                    err_str = _("%(name)s (not found)")
                elif not avc.is_installed():
                    # Translators: This error message is shown when a version
                    # control binary isn't installed.
                    err_str = _("%(name)s (%(cmd)s not installed)")
                elif not avc.valid_repo(location):
                    # Translators: This error message is shown when a version
                    # controlled repository is invalid.
                    err_str = _("%(name)s (invalid repository)")

                if err_str:
                    vcs_model.append([err_str % vc_details, avc, False])
                    continue

                vcs_model.append([avc.NAME, avc(location), True])

        default_active = self.get_default_vc(vcs_model)

        if not any(enabled for _, _, enabled in vcs_model):
            # If we didn't get any valid vcs then fallback to null
            null_vcs = _null.Vc(location)
            vcs_model.insert(0, [null_vcs.NAME, null_vcs, True])
            tooltip = _("No valid version control system found in this folder")
        else:
            tooltip = _("Choose which version control system to use")

        self.combobox_vcs.set_tooltip_text(tooltip)
        self.combobox_vcs.set_active(default_active)
开发者ID:GNOME,项目名称:meld,代码行数:52,代码来源:vcview.py


示例7: _make_copy_menu

    def _make_copy_menu(self, chunk):
        copy_menu = Gtk.Menu()
        copy_up = Gtk.MenuItem.new_with_mnemonic(_('Copy _up'))
        copy_down = Gtk.MenuItem.new_with_mnemonic(_('Copy _down'))
        copy_menu.append(copy_up)
        copy_menu.append(copy_down)
        copy_menu.show_all()

        def copy_chunk(widget, action):
            self._action_on_chunk(action, chunk)

        copy_up.connect('activate', copy_chunk, ChunkAction.copy_up)
        copy_down.connect('activate', copy_chunk, ChunkAction.copy_down)
        return copy_menu
开发者ID:GNOME,项目名称:meld,代码行数:14,代码来源:actiongutter.py


示例8: shorten_names

def shorten_names(*names: str) -> List[str]:
    """Remove common parts of a list of paths

    For example, `('/tmp/foo1', '/tmp/foo2')` would be summarised as
    `('foo1', 'foo2')`. Paths that share a basename are distinguished
    by prepending an indicator, e.g., `('/a/b/c', '/a/d/c')` would be
    summarised to `['[b] c', '[d] c']`.
    """

    paths = [PurePath(n) for n in names]

    # Identify the longest common path among the list of path
    common = set(paths[0].parents)
    common = common.intersection(*(p.parents for p in paths))
    if not common:
        return list(names)
    common_parent = sorted(common, key=lambda p: -len(p.parts))[0]

    paths = [p.relative_to(common_parent) for p in paths]
    basenames = [p.name for p in paths]

    if all_same(basenames):
        def firstpart(path: PurePath) -> str:
            if len(path.parts) > 1 and path.parts[0]:
                return "[%s] " % path.parts[0]
            else:
                return ""
        return [firstpart(p) + p.name for p in paths]

    return [name or _("[None]") for name in basenames]
开发者ID:GNOME,项目名称:meld,代码行数:30,代码来源:misc.py


示例9: colour_lookup_with_fallback

def colour_lookup_with_fallback(name, attribute):
    from meld.settings import meldsettings
    source_style = meldsettings.style_scheme

    style = source_style.get_style(name)
    style_attr = getattr(style.props, attribute) if style else None
    if not style or not style_attr:
        manager = GtkSource.StyleSchemeManager.get_default()
        source_style = manager.get_scheme(MELD_STYLE_SCHEME)
        try:
            style = source_style.get_style(name)
            style_attr = getattr(style.props, attribute)
        except AttributeError:
            pass

    if not style_attr:
        import sys
        print >> sys.stderr, _(
            "Couldn't find colour scheme details for %s-%s; "
            "this is a bad install") % (name, attribute)
        sys.exit(1)

    colour = Gdk.RGBA()
    colour.parse(style_attr)
    return colour
开发者ID:KateWilkins,项目名称:meld,代码行数:25,代码来源:misc.py


示例10: shorten_names

def shorten_names(*names):
    """Remove redunant parts of a list of names (e.g. /tmp/foo{1,2} -> foo{1,2}
    """
    # TODO: Update for different path separators
    prefix = os.path.commonprefix(names)
    prefixslash = prefix.rfind("/") + 1

    names = [n[prefixslash:] for n in names]
    paths = [n.split("/") for n in names]

    try:
        basenames = [p[-1] for p in paths]
    except IndexError:
        pass
    else:
        if all_same(basenames):
            def firstpart(alist):
                if len(alist) > 1:
                    return "[%s] " % alist[0]
                else:
                    return ""
            roots = [firstpart(p) for p in paths]
            base = basenames[0].strip()
            return [r + base for r in roots]
    # no common path. empty names get changed to "[None]"
    return [name or _("[None]") for name in basenames]
开发者ID:surjit,项目名称:meld-3.14.2,代码行数:26,代码来源:misc.py


示例11: _update_notebook_menu

    def _update_notebook_menu(self, *args):
        if self.tab_switch_merge_id:
            self.ui.remove_ui(self.tab_switch_merge_id)
            self.ui.remove_action_group(self.tab_switch_actiongroup)

        self.tab_switch_merge_id = self.ui.new_merge_id()
        self.tab_switch_actiongroup = Gtk.ActionGroup(name="TabSwitchActions")
        self.ui.insert_action_group(self.tab_switch_actiongroup)
        group = None
        current_page = self.notebook.get_current_page()
        for i in range(self.notebook.get_n_pages()):
            page = self.notebook.get_nth_page(i)
            label = self.notebook.get_menu_label_text(page) or ""
            name = "SwitchTab%d" % i
            tooltip = _("Switch to this tab")
            action = Gtk.RadioAction(name=name, label=label, tooltip=tooltip, stock_id=None, value=i)
            action.join_group(group)
            group = action
            action.set_active(current_page == i)

            def current_tab_changed_cb(action, current):
                if action == current:
                    self.notebook.set_current_page(action.get_current_value())
            action.connect("changed", current_tab_changed_cb)
            if i < 10:
                accel = "<Alt>%d" % ((i + 1) % 10)
            else:
                accel = None
            self.tab_switch_actiongroup.add_action_with_accel(action, accel)
            self.ui.add_ui(self.tab_switch_merge_id,
                           "/Menubar/TabMenu/TabPlaceholder",
                           name, name, Gtk.UIManagerItemType.MENUITEM, False)
开发者ID:Psykar,项目名称:meld,代码行数:32,代码来源:meldwindow.py


示例12: _update_tree_state_cache

    def _update_tree_state_cache(self, path):
        while 1:
            try:
                proc = _vc.popen(
                    [self.CMD, "status", "-v", "--xml", path],
                    cwd=self.location)
                tree = ElementTree.parse(proc)
                break
            except OSError as e:
                if e.errno != errno.EAGAIN:
                    raise

        for target in tree.findall("target") + tree.findall("changelist"):
            for entry in (t for t in target.getchildren() if t.tag == "entry"):
                path = entry.attrib["path"]
                if not path:
                    continue
                if not os.path.isabs(path):
                    path = os.path.abspath(os.path.join(self.location, path))
                for status in (e for e in entry.getchildren() \
                               if e.tag == "wc-status"):
                    item = status.attrib["item"]
                    if item == "":
                        continue
                    state = self.state_map.get(item, _vc.STATE_NONE)
                    self._tree_cache[path] = state

                    rev = status.attrib.get("revision")
                    rev_label = _("Rev %s") % rev if rev is not None else ''
                    self._tree_meta_cache[path] = rev_label
开发者ID:uestclx,项目名称:meld,代码行数:30,代码来源:svn.py


示例13: run

    def run(self):
        self.update_patch()

        while 1:
            result = self.widget.run()
            if result < 0:
                break

            buf = self.textview.get_buffer()
            start, end = buf.get_bounds()
            txt = text_type(buf.get_text(start, end, False), 'utf8')

            # Copy patch to clipboard
            if result == 1:
                clip = Gtk.clipboard_get()
                clip.set_text(txt)
                clip.store()
                break
            # Save patch as a file
            else:
                # FIXME: These filediff methods are actually general utility.
                filename = self.filediff._get_filename_for_saving(
                    _("Save Patch"))
                if filename:
                    txt = txt.encode('utf-8')
                    self.filediff._save_text_to_filename(filename, txt)
                    break

        self.widget.hide()
开发者ID:Puneeth-n,项目名称:meld,代码行数:29,代码来源:patchdialog.py


示例14: _update_tree_state_cache

    def _update_tree_state_cache(self, path, tree_state):
        """ Update the state of the file(s) at tree_state['path'] """
        while 1:
            try:
                entries = self._get_modified_files(path)

                # Identify ignored files and folders
                proc = _vc.popen([self.CMD, "ls-files", "--others",
                                  "--ignored", "--exclude-standard",
                                  "--directory", path],
                                 cwd=self.location)
                ignored_entries = proc.read().split("\n")[:-1]

                # Identify unversioned files
                proc = _vc.popen([self.CMD, "ls-files", "--others",
                                  "--exclude-standard", path],
                                 cwd=self.location)
                unversioned_entries = proc.read().split("\n")[:-1]

                break
            except OSError as e:
                if e.errno != errno.EAGAIN:
                    raise

        if len(entries) == 0 and os.path.isfile(path):
            # If we're just updating a single file there's a chance that it
            # was it was previously modified, and now has been edited
            # so that it is un-modified.  This will result in an empty
            # 'entries' list, and tree_state['path'] will still contain stale
            # data.  When this corner case occurs we force tree_state['path']
            # to STATE_NORMAL.
            path = os.path.abspath(path)
            tree_state[path] = _vc.STATE_NORMAL
        else:
            # There are 1 or more modified files, parse their state
            for entry in entries:
                columns = self.DIFF_RE.search(entry).groups()
                old_mode, new_mode, statekey, name = columns
                if os.name == 'nt':
                    # Git returns unix-style paths on Windows
                    name = os.path.normpath(name.strip())
                path = os.path.join(self.root, name.strip())
                path = os.path.abspath(path)
                state = self.state_map.get(statekey.strip(), _vc.STATE_NONE)
                tree_state[path] = state
                if old_mode != new_mode:
                    msg = _("Mode changed from %s to %s" %
                            (old_mode, new_mode))
                    self._tree_meta_cache[path] = msg

            for entry in ignored_entries:
                path = os.path.join(self.location, entry.strip())
                path = os.path.abspath(path)
                tree_state[path] = _vc.STATE_IGNORED

            for entry in unversioned_entries:
                path = os.path.join(self.location, entry.strip())
                path = os.path.abspath(path)
                tree_state[path] = _vc.STATE_NONE
开发者ID:Psykar,项目名称:meld,代码行数:59,代码来源:git.py


示例15: _update_tree_state_cache

    def _update_tree_state_cache(self, path):
        """ Update the state of the file(s) at self._tree_cache['path'] """
        while 1:
            try:
                entries = self._get_modified_files(path)

                # Identify ignored files and folders
                proc = self.run(
                    "ls-files", "--others", "--ignored", "--exclude-standard",
                    "--directory", path)
                ignored_entries = proc.stdout.read().split("\n")[:-1]

                # Identify unversioned files
                proc = self.run(
                    "ls-files", "--others", "--exclude-standard", path)
                unversioned_entries = proc.stdout.read().split("\n")[:-1]

                break
            except OSError as e:
                if e.errno != errno.EAGAIN:
                    raise

        def get_real_path(name):
            name = name.strip()
            if os.name == 'nt':
                # Git returns unix-style paths on Windows
                name = os.path.normpath(name)

            # Unicode file names and file names containing quotes are
            # returned by git as quoted strings
            if name[0] == '"':
                name = name[1:-1].decode('string_escape')
            return os.path.abspath(
                os.path.join(self.location, name))

        if len(entries) == 0 and os.path.isfile(path):
            # If we're just updating a single file there's a chance that it
            # was it was previously modified, and now has been edited so that
            # it is un-modified.  This will result in an empty 'entries' list,
            # and self._tree_cache['path'] will still contain stale data.
            # When this corner case occurs we force self._tree_cache['path']
            # to STATE_NORMAL.
            self._tree_cache[get_real_path(path)] = _vc.STATE_NORMAL
        else:
            for entry in entries:
                columns = self.DIFF_RE.search(entry).groups()
                old_mode, new_mode, statekey, path = columns
                state = self.state_map.get(statekey.strip(), _vc.STATE_NONE)
                self._tree_cache[get_real_path(path)] = state
                if old_mode != new_mode:
                    msg = _("Mode changed from %s to %s" %
                            (old_mode, new_mode))
                    self._tree_meta_cache[path] = msg

            for path in ignored_entries:
                self._tree_cache[get_real_path(path)] = _vc.STATE_IGNORED

            for path in unversioned_entries:
                self._tree_cache[get_real_path(path)] = _vc.STATE_NONE
开发者ID:uestclx,项目名称:meld,代码行数:59,代码来源:git.py


示例16: on_consoleview_populate_popup

 def on_consoleview_populate_popup(self, textview, menu):
     buf = textview.get_buffer()
     clear_cb = lambda *args: buf.delete(*buf.get_bounds())
     clear_action = Gtk.MenuItem.new_with_label(_("Clear"))
     clear_action.connect("activate", clear_cb)
     menu.insert(clear_action, 0)
     menu.insert(Gtk.SeparatorMenuItem(), 1)
     menu.show_all()
开发者ID:thics,项目名称:meld,代码行数:8,代码来源:vcview.py


示例17: run_diff

    def run_diff(self, path):
        if os.path.isdir(path):
            self.emit("create-diff", [path], {})
            return

        left_is_local = self.props.left_is_local
        basename = os.path.basename(path)
        meta = {
            'parent': self,
            'prompt_resolve': False,
        }

        # May have removed directories in list.
        vc_entry = self.vc.get_entry(path)
        if vc_entry and vc_entry.state == tree.STATE_CONFLICT and \
                hasattr(self.vc, 'get_path_for_conflict'):
            local_label = _(u"%s — local") % basename
            remote_label = _(u"%s — remote") % basename

            # We create new temp files for other, base and this, and
            # then set the output to the current file.
            if self.props.merge_file_order == "local-merge-remote":
                conflicts = (tree.CONFLICT_THIS, tree.CONFLICT_MERGED,
                             tree.CONFLICT_OTHER)
                meta['labels'] = (local_label, None, remote_label)
                meta['tablabel'] = _(u"%s (local, merge, remote)") % basename
            else:
                conflicts = (tree.CONFLICT_OTHER, tree.CONFLICT_MERGED,
                             tree.CONFLICT_THIS)
                meta['labels'] = (remote_label, None, local_label)
                meta['tablabel'] = _(u"%s (remote, merge, local)") % basename
            diffs = [self.vc.get_path_for_conflict(path, conflict=c)
                     for c in conflicts]
            temps = [p for p, is_temp in diffs if is_temp]
            diffs = [p for p, is_temp in diffs]
            kwargs = {
                'auto_merge': False,
                'merge_output': path,
            }
            meta['prompt_resolve'] = True
        else:
            remote_label = _(u"%s — repository") % basename
            comp_path = self.vc.get_path_for_repo_file(path)
            temps = [comp_path]
            if left_is_local:
                diffs = [path, comp_path]
                meta['labels'] = (None, remote_label)
                meta['tablabel'] = _(u"%s (working, repository)") % basename
            else:
                diffs = [comp_path, path]
                meta['labels'] = (remote_label, None)
                meta['tablabel'] = _(u"%s (repository, working)") % basename
            kwargs = {}
        kwargs['meta'] = meta

        for temp_file in temps:
            os.chmod(temp_file, 0o444)
            _temp_files.append(temp_file)

        self.emit("create-diff", diffs, kwargs)
开发者ID:fy2,项目名称:meld,代码行数:60,代码来源:vcview.py


示例18: append_filemerge

 def append_filemerge(self, files, merge_output=None):
     if len(files) != 3:
         raise ValueError(_("Need three files to auto-merge, got: %r") % files)
     doc = filemerge.FileMerge(len(files))
     self._append_page(doc, "text-x-generic")
     doc.set_files(files)
     if merge_output is not None:
         doc.set_merge_output_file(merge_output)
     return doc
开发者ID:poetnerd,项目名称:meld,代码行数:9,代码来源:meldwindow.py


示例19: prompt_save_filename

def prompt_save_filename(
        title: str, parent: Optional[Gtk.Widget] = None) -> Optional[Gio.File]:

    dialog = MeldFileChooserDialog(
        title,
        transient_for=get_modal_parent(parent),
        action=Gtk.FileChooserAction.SAVE,
    )
    dialog.set_default_response(Gtk.ResponseType.ACCEPT)
    response = dialog.run()
    gfile = dialog.get_file()
    dialog.destroy()

    if response != Gtk.ResponseType.ACCEPT or not gfile:
        return None

    try:
        file_info = gfile.query_info(
            'standard::name,standard::display-name', 0, None)
    except GLib.Error as err:
        if err.code == Gio.IOErrorEnum.NOT_FOUND:
            return gfile
        raise

    # The selected file exists, so we need to prompt for overwrite.
    parent_name = gfile.get_parent().get_parse_name()
    file_name = file_info.get_display_name()

    replace = modal_dialog(
        primary=_("Replace file “%s”?") % file_name,
        secondary=_(
            "A file with this name already exists in “%s”.\n"
            "If you replace the existing file, its contents "
            "will be lost.") % parent_name,
        buttons=[
            (_("_Cancel"), Gtk.ResponseType.CANCEL),
            (_("_Replace"), Gtk.ResponseType.OK),
        ],
        messagetype=Gtk.MessageType.WARNING,
    )
    if replace != Gtk.ResponseType.OK:
        return None

    return gfile
开发者ID:GNOME,项目名称:meld,代码行数:44,代码来源:iohelpers.py


示例20: on_button_delete_clicked

 def on_button_delete_clicked(self, obj):
     files = self._get_selected_files()
     for name in files:
         try:
             gfile = Gio.File.new_for_path(name)
             gfile.trash(None)
         except GLib.GError as e:
             misc.error_dialog(_("Error removing %s") % name, str(e))
     workdir = _commonprefix(files)
     self.refresh_partial(workdir)
开发者ID:fy2,项目名称:meld,代码行数:10,代码来源:vcview.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python meli.Meli类代码示例发布时间:2022-05-27
下一篇:
Python utils.utcnow函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap