Exemple #1
0
    2: u"двісті",
    3: u"триста",
    4: u"чотириста",
    5: u"п'ятсот",
    6: u"шістсот",
    7: u"сімсот",
    8: u"вісімсот",
    9: u"дев'ятсот",
}  #: Hundreds

MALE = 1  #: sex - male
FEMALE = 2  #: sex - female
NEUTER = 3  #: sex - neuter


@takes((int, long, float, Decimal), optional(int), signs=optional(int))
def _get_float_remainder(fvalue, signs=9):
    """
    Get remainder of float, i.e. 2.05 -> '05'

    @param fvalue: input value
    @type fvalue: C{int}, C{long}, C{float} or C{Decimal}

    @param signs: maximum number of signs
    @type signs: C{int} or C{long}

    @return: remainder
    @rtype: C{str}

    @raise L{uktils.err.InputParameterError}: input parameters' check failed
        (fvalue neither C{int}, no C{float})
Exemple #2
0
    (u"лис", u"листопад", u"листопада"),
    (u"гру", u"грудень", u"грудня"),
    )  #: Month names (abbreviated, full, inflected)

DAY_NAMES = (
    (u"пн", u"понеділок", u"понеділок", u"в\xa0"),
    (u"вт", u"вівторок", u"вівторок", u"у\xa0"),
    (u"ср", u"середа", u"середу", u"в\xa0"),
    (u"чт", u"четвер", u"четвер", u"у\xa0"),
    (u"пт", u"п'ятниця", u"п'ятницю", u"у\xa0"),
    (u"сб", u"субота", u"суботу", u"в\xa0"),
    (u"нд", u"неділя", u"неділю", u"в\xa0")
    )  #: Day names (abbreviated, full, inflected, preposition)

@takes((int, float, datetime.datetime),
       optional(int),
       optional((int, float, datetime.datetime)),
       accuracy=optional(int),
       to_time=optional((int, float, datetime.datetime)))
@returns(unicode)
def distance_of_time_in_words(from_time, accuracy=1, to_time=None):
    """
    Represents distance of time in words

    @param from_time: source time (in seconds from epoch)
    @type from_time: C{int}, C{float} or C{datetime.datetime}

    @param accuracy: level of accuracy (1..3), default=1
    @type accuracy: C{int}

    @param to_time: target time (in seconds from epoch),