~rosco2/ubuntu/wily/gramps/bug-1492304

« back to all changes in this revision

Viewing changes to gramps/gui/views/treemodels/citationbasemodel.py

  • Committer: Package Import Robot
  • Author(s): Ross Gammon
  • Date: 2015-08-11 23:03:11 UTC
  • mfrom: (1.4.3)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20150811230311-acjr8gcfe8isx7ij
* New upstream release
* Drop patches applied upstream or cherry-picked from there
* Add version constraints for gtk and pygobject
* Add goocanvas dependency - available soon
* Drop webkit dpendency as HTML view has been removed
* Force removal of upstream packages when installing Debian one
  (LP: #1464845)
* Drop fixperm override as permissions fixed upstream
* Fix spelling error in changelog
* Switch to nose for unit tests
* Add build dependencies for the nose tests
* Update copyright file
* Add uversionmangle to watch file to deal with alpha/beta versions
* Add manual test cases
* Drop FAQ URL from upstream metadata - changes every release
* Add patch to fix transparent windows in Ubuntu.
  Thanks to Lance Orner (LP: #1451259)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
# python modules
29
29
#
30
30
#-------------------------------------------------------------------------
31
 
import cgi
 
31
from html import escape
32
32
import logging
33
33
log = logging.getLogger(".")
34
34
LOG = logging.getLogger(".citation")
44
44
from gramps.gen.lib import Citation
45
45
from gramps.gen.utils.string import conf_strings
46
46
from gramps.gen.config import config
47
 
from gramps.gen.constfunc import cuni
48
47
 
49
48
#-------------------------------------------------------------------------
50
49
#
91
90
            citation.unserialize(data)
92
91
            date_str =  get_date(citation)
93
92
            if date_str != "":
94
 
                retval = cgi.escape(date_str)
 
93
                retval = escape(date_str)
95
94
            if not get_date_valid(citation):
96
95
                return INVALID_DATE_FORMAT % retval
97
96
            else:
110
109
        return ''    
111
110
    
112
111
    def citation_id(self, data):
113
 
        return cuni(data[COLUMN_ID])
 
112
        return str(data[COLUMN_ID])
114
113
 
115
114
    def citation_page(self, data):
116
 
        return cuni(data[COLUMN_PAGE])
 
115
        return str(data[COLUMN_PAGE])
117
116
 
118
117
    def citation_confidence(self, data):
119
 
        return cuni(_(conf_strings[data[COLUMN_CONFIDENCE]]))
 
118
        return str(_(conf_strings[data[COLUMN_CONFIDENCE]]))
120
119
 
121
120
    def citation_private(self, data):
122
121
        if data[COLUMN_PRIV]:
160
159
        source_handle = data[COLUMN_SOURCE]
161
160
        try:
162
161
            source = self.db.get_source_from_handle(source_handle)
163
 
            return cuni(source.get_title())
 
162
            return str(source.get_title())
164
163
        except:
165
164
            return ''
166
165
 
168
167
        source_handle = data[COLUMN_SOURCE]
169
168
        try:
170
169
            source = self.db.get_source_from_handle(source_handle)
171
 
            return cuni(source.gramps_id)
 
170
            return str(source.gramps_id)
172
171
        except:
173
172
            return ''
174
173
 
176
175
        source_handle = data[COLUMN_SOURCE]
177
176
        try:
178
177
            source = self.db.get_source_from_handle(source_handle)
179
 
            return cuni(source.get_author())
 
178
            return str(source.get_author())
180
179
        except:
181
180
            return ''
182
181
 
184
183
        source_handle = data[COLUMN_SOURCE]
185
184
        try:
186
185
            source = self.db.get_source_from_handle(source_handle)
187
 
            return cuni(source.get_abbreviation())
 
186
            return str(source.get_abbreviation())
188
187
        except:
189
188
            return ''
190
189
 
192
191
        source_handle = data[COLUMN_SOURCE]
193
192
        try:
194
193
            source = self.db.get_source_from_handle(source_handle)
195
 
            return cuni(source.get_publication_info())
 
194
            return str(source.get_publication_info())
196
195
        except:
197
196
            return ''
198
197
 
228
227
# Fields access when 'data' is a Source
229
228
 
230
229
    def source_src_title(self, data):
231
 
        return cuni(data[COLUMN2_TITLE])
 
230
        return str(data[COLUMN2_TITLE])
232
231
 
233
232
    def source_src_id(self, data):
234
 
        return cuni(data[COLUMN2_ID])
 
233
        return str(data[COLUMN2_ID])
235
234
 
236
235
    def source_src_auth(self, data):
237
 
        return cuni(data[COLUMN2_AUTHOR])
 
236
        return str(data[COLUMN2_AUTHOR])
238
237
 
239
238
    def source_src_abbr(self, data):
240
 
        return cuni(data[COLUMN2_ABBREV])
 
239
        return str(data[COLUMN2_ABBREV])
241
240
 
242
241
    def source_src_pinfo(self, data):
243
 
        return cuni(data[COLUMN2_PUBINFO])
 
242
        return str(data[COLUMN2_PUBINFO])
244
243
 
245
244
    def source_src_private(self, data):
246
245
        if data[COLUMN2_PRIV]: