MCPcopy
hub / github.com/pyload/pyload / _parse_date_greek

Function _parse_date_greek

module/lib/feedparser.py:3155–3169  ·  view source on GitHub ↗

Parse a string according to a Greek 8-bit date format.

(dateString)

Source from the content-addressed store, hash-verified

3153 re.compile(u'([^,]+),\s+(\d{2})\s+([^\s]+)\s+(\d{4})\s+(\d{2}):(\d{2}):(\d{2})\s+([^\s]+)')
3154
3155def _parse_date_greek(dateString):
3156 '''Parse a string according to a Greek 8-bit date format.'''
3157 m = _greek_date_format_re.match(dateString)
3158 if not m: return
3159 try:
3160 wday = _greek_wdays[m.group(1)]
3161 month = _greek_months[m.group(3)]
3162 except:
3163 return
3164 rfc822date = '%(wday)s, %(day)s %(month)s %(year)s %(hour)s:%(minute)s:%(second)s %(zonediff)s' % \
3165 {'wday': wday, 'day': m.group(2), 'month': month, 'year': m.group(4),\
3166 'hour': m.group(5), 'minute': m.group(6), 'second': m.group(7),\
3167 'zonediff': m.group(8)}
3168 if _debug: sys.stderr.write('Greek date parsed as: %s\n' % rfc822date)
3169 return _parse_date_rfc822(rfc822date)
3170registerDateHandler(_parse_date_greek)
3171
3172# Unicode strings for Hungarian date strings

Callers

nothing calls this directly

Calls 3

_parse_date_rfc822Function · 0.85
matchMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected