Beispiel #1
0
def news_template(feed):
    global news_temp
    timeago = force_unicode(timesince(feed.create_date), "utf-8")
    tmp = news_temp[feed.news_type]
    tmp = force_unicode(tmp, "utf-8")

    tmp = tmp.replace('{{actioner}}', feed.actioner.username)
    tmp = tmp.replace('{{commit}}', feed.pull.merged_commit_hexsha[:10])
    tmp = tmp.replace('{{to_head}}', feed.pull.to_head)
    tmp = tmp.replace('{{from_head}}', feed.pull.from_head)
    tmp = tmp.replace('{{time_ago}}', timeago)

    return tmp
Beispiel #2
0
def news_template(feed):
  global news_temp
  timeago = force_unicode(timesince(feed.create_date),"utf-8")
  tmp = news_temp[feed.news_type]
  tmp = force_unicode(tmp, "utf-8")

  tmp = tmp.replace('{{actioner}}', feed.actioner.username)
  tmp = tmp.replace('{{commit}}', feed.pull.merged_commit_hexsha[:10])
  tmp = tmp.replace('{{to_head}}', feed.pull.to_head)
  tmp = tmp.replace('{{from_head}}', feed.pull.from_head)
  tmp = tmp.replace('{{time_ago}}', timeago)

  return tmp
Beispiel #3
0
def milestone_dueday(duedate):
    return timesince(duedate, future=True)
Beispiel #4
0
def milestone_dueday(duedate):
    return timesince(duedate, future=True)