Module statsdb
source code
Module to provide a cache of statistics in a database.
Organization:
Zuza Software Foundation
Copyright:
2007 Zuza Software Foundation
License:
GPL
|
Record
|
|
FileTotals
|
|
StatsCache
An object instantiated as a singleton for each statsfile that
provides access to the database cache from a pool of StatsCache
objects.
|
|
|
|
|
|
|
|
statefordb(unit)
Returns the numeric database state for the unit. |
source code
|
|
|
emptyfiletotals()
Returns a dictionary with all statistics initalised to 0. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kdepluralre = re.compile("^_n: ")
|
|
brtagre = re.compile("<br\s*?/?>")
|
|
xmltagre = re.compile("<[^>]+>")
|
|
numberre = re.compile("\\D\\.\\D")
|
|
extended_state_strings = {StateEnum.EMPTY: "empty", StateEnum....
|
|
UNTRANSLATED = 0
|
|
FUZZY = 30
|
|
TRANSLATED = 100
|
|
state_strings = {UNTRANSLATED: "untranslated", FUZZY: "fuzzy",...
|
Imports:
dbapi2,
os,
re,
sys,
stat,
thread,
UserDict,
toolkitversion,
Common,
multistring,
factory,
StateEnum
Counts the words in the unit's source and target, taking plurals into
account. The target words are only counted if the unit is translated.
|
Modifies f to commit database changes if it executes without
exceptions. Otherwise it rolls back the database.
ALL publicly accessible methods in StatsCache MUST be decorated with
this decorator.
|
extended_state_strings
- Value:
{StateEnum.EMPTY: "empty", StateEnum.NEEDS_WORK: "needs-work", StateEn
um.REJECTED: "rejected", StateEnum.NEEDS_REVIEW: "needs-review", State
Enum.UNREVIEWED: "unreviewed", StateEnum.FINAL: "final",}
|
|
state_strings
- Value:
{UNTRANSLATED: "untranslated", FUZZY: "fuzzy", TRANSLATED: "translated
",}
|
|