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

« back to all changes in this revision

Viewing changes to gramps/gen/utils/cast.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:
41
41
#-------------------------------------------------------------------------
42
42
from ..const import GRAMPS_LOCALE as glocale
43
43
_ = glocale.translation.gettext
44
 
from ..constfunc import conv_to_unicode, conv_to_unicode_direct, UNITYPE, STRTYPE
 
44
from ..constfunc import conv_to_unicode
45
45
 
46
46
#strings in database are utf-8
47
47
conv_dbstr_to_unicode = lambda x: conv_to_unicode(x, 'UTF-8')
54
54
    Return function that converts strings into the type of val.
55
55
    """
56
56
    val_type = type(val)
57
 
    if isinstance(val, STRTYPE):
 
57
    if isinstance(val, str):
58
58
        return str
59
59
    elif val_type == int:
60
60
        return int
79
79
        return 'float'
80
80
    elif val_type == bool:
81
81
        return 'bool'
82
 
    elif isinstance(val, STRTYPE):
 
82
    elif isinstance(val, str):
83
83
        return 'unicode'
84
84
    return 'unicode'
85
85