~ubuntu-branches/ubuntu/vivid/git-cola/vivid

« back to all changes in this revision

Viewing changes to cola/widgets/patch.py

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2014-03-22 15:10:46 UTC
  • mfrom: (1.3.23)
  • Revision ID: package-import@ubuntu.com-20140322151046-s2lfr17hej2brlbu
Tags: 2.0.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import division, absolute_import, unicode_literals
 
2
 
1
3
import os
2
4
 
3
5
from PyQt4 import QtCore
11
13
from cola.widgets import defs
12
14
from cola.widgets.standard import Dialog
13
15
from cola.widgets.standard import DraggableTreeWidget
 
16
from cola.compat import ustr
14
17
 
15
18
 
16
19
def apply_patches():
44
47
    urls = mimedata.urls()
45
48
    if not urls:
46
49
        return []
47
 
    paths = map(lambda x: unicode(x.path()), urls)
 
50
    paths = map(lambda x: ustr(x.path()), urls)
48
51
    return get_patches_from_paths(paths)
49
52
 
50
53
 
140
143
        items = self.tree.items()
141
144
        if not items:
142
145
            return
143
 
        patches = [unicode(i.data(0, Qt.UserRole).toPyObject()) for i in items]
 
146
        patches = [ustr(i.data(0, Qt.UserRole).toPyObject()) for i in items]
144
147
        cmds.do(cmds.ApplyPatches, patches)
145
148
        self.accept()
146
149
 
150
153
                                   filter='Patches (*.patch *.mbox)')
151
154
        if not files:
152
155
            return
153
 
        files = [unicode(f) for f in files]
 
156
        files = [ustr(f) for f in files]
154
157
        self.curdir = os.path.dirname(files[0])
155
158
        self.add_paths([os.path.relpath(f) for f in files])
156
159