MCPcopy
hub / github.com/tonquer/JMComic-qt / GetUpdateStrByTick

Method GetUpdateStrByTick

src/tools/tool.py:109–124  ·  view source on GitHub ↗
(tick)

Source from the content-addressed store, hash-verified

107
108 @staticmethod
109 def GetUpdateStrByTick(tick):
110 now = int(time.time())
111 day = (now - tick) // (24*3600)
112 hour = (now - tick) // 3600
113 minute = (now - tick) // 60
114 second = (now - tick)
115
116 from tools.str import Str
117 if day > 0:
118 return "{}".format(day) + Str.GetStr(Str.DayAgo)
119 elif hour > 0:
120 return "{}".format(hour) + Str.GetStr(Str.HourAgo)
121 elif minute > 0:
122 return "{}".format(minute) + Str.GetStr(Str.MinuteAgo)
123 else:
124 return "{}".format(second) + Str.GetStr(Str.SecondAgo)
125
126 @staticmethod
127 def GetDownloadSize(downloadLen):

Callers 2

AddBookByLocalMethod · 0.80
AddBookItemByHistoryMethod · 0.80

Calls 1

GetStrMethod · 0.80

Tested by

no test coverage detected