Protect crashing from malformed data; working on locale-based issues; fast flush; UI focus

svn: r13647
This commit is contained in:
Doug Blank
2009-11-21 23:18:35 +00:00
parent 281fa65cd7
commit 4189b78df3
7 changed files with 155 additions and 34 deletions

View File

@ -11,6 +11,8 @@ from cli.grampscli import CLIManager
from django.template import escape
from django.contrib.contenttypes.models import ContentType
import locale
dji = libdjango.DjangoInterface()
_dd = DateHandler.displayer.display
@ -27,6 +29,11 @@ def probably_alive(handle):
db = DjangoDb()
return Utils.probably_alive(db.get_person_from_handle(handle), db)
def format_number(number, with_grouping=True):
# FIXME: should be user's setting
locale.setlocale(locale.LC_ALL, "en_US.utf8")
return locale.format("%d", number, with_grouping)
class Table(object):
"""
>>> table = Table()