소스 검색

Add EVE date to footer.

master
Ben Kurtovic 7 년 전
부모
커밋
bf7e58dba9
3개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. +6
    -0
      calefaction/eve/__init__.py
  2. +13
    -0
      calefaction/eve/clock.py
  3. +2
    -0
      templates/_base.mako

+ 6
- 0
calefaction/eve/__init__.py 파일 보기

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from .clock import Clock
from .image import ImageServer

__all__ = ["EVE"]
@@ -7,8 +8,13 @@ __all__ = ["EVE"]
class EVE:

def __init__(self):
self._clock = Clock()
self._image = ImageServer()

@property
def clock(self):
return self._clock

@property
def image(self):
return self._image

+ 13
- 0
calefaction/eve/clock.py 파일 보기

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-

from datetime import datetime

__all__ = ["Clock"]

YEAR_DELTA = 1898

class Clock:

def now(self):
dt = datetime.utcnow()
return str(dt.year - YEAR_DELTA) + dt.strftime("-%m-%d %H:%M")

+ 2
- 0
templates/_base.mako 파일 보기

@@ -44,6 +44,8 @@
<%block name="footer">
<footer>
<div>
YC ${g.eve.clock.now()}
&bull;
Running <a href="https://github.com/earwig/calefaction">Calefaction</a> ${g.version}
&bull;
<a href="https://eveonline.com">EVE Online</a> and all related trademarks are property of <a href="https://ccpgames.com">CCP hf</a>.


불러오는 중...
취소
저장