store norloge in right format
This commit is contained in:
parent
cedf1f7970
commit
01c9d1ded8
1 changed files with 11 additions and 0 deletions
|
|
@ -18,15 +18,26 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
|
||||||
class Message(object):
|
class Message(object):
|
||||||
|
TIMESTAMP_REGEXP = re.compile(r'(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})')
|
||||||
def __init__(self, id, timestamp, login, message, is_me):
|
def __init__(self, id, timestamp, login, message, is_me):
|
||||||
self.id = id
|
self.id = id
|
||||||
self.timestamp = timestamp
|
self.timestamp = timestamp
|
||||||
self.login = login
|
self.login = login
|
||||||
self.message = message
|
self.message = message
|
||||||
self.is_me = is_me
|
self.is_me = is_me
|
||||||
|
self.norloge = timestamp
|
||||||
|
m = self.TIMESTAMP_REGEXP.match(timestamp)
|
||||||
|
if m:
|
||||||
|
self.norloge = '%02d:%02d:%02d' % (int(m.group(4)),
|
||||||
|
int(m.group(5)),
|
||||||
|
int(m.group(6)))
|
||||||
|
else:
|
||||||
|
warning('Unable to parse timestamp "%s"' % timestamp)
|
||||||
|
|
||||||
class BoardIndexPage(BasePage):
|
class BoardIndexPage(BasePage):
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue