Last change
on this file since 100 was 100, checked in by ruud, 21 months ago |
python installs also wheel to avoid error messages
|
File size:
1015 bytes
|
Line | |
---|
1 | from datetime import datetime
|
---|
2 |
|
---|
3 | from geniusweb.deadline.Deadline import Deadline
|
---|
4 | from geniusweb.deadline.DeadlineRounds import DeadlineRounds
|
---|
5 | from geniusweb.deadline.DeadlineTime import DeadlineTime
|
---|
6 | from geniusweb.progress.Progress import Progress
|
---|
7 | from geniusweb.progress.ProgressRounds import ProgressRounds
|
---|
8 | from geniusweb.progress.ProgressTime import ProgressTime
|
---|
9 |
|
---|
10 |
|
---|
11 | class ProgressFactory:
|
---|
12 | @staticmethod
|
---|
13 | def create( deadline: Deadline, nowms:int) -> Progress :
|
---|
14 | '''
|
---|
15 | @param deadline the deadline to create a progress for
|
---|
16 | @param nowms The time as from {@link System#currentTimeMillis()} that
|
---|
17 | is to be used as start time for the progress.
|
---|
18 | @return new Progress matching the deadline type.
|
---|
19 | '''
|
---|
20 | assert isinstance(deadline, Deadline)
|
---|
21 | if isinstance(deadline,DeadlineRounds):
|
---|
22 | return ProgressRounds( deadline.getRounds(),
|
---|
23 | 0, datetime.fromtimestamp( (nowms + deadline.getDuration())/1000.))
|
---|
24 | else:
|
---|
25 | return ProgressTime(deadline.getDuration(),datetime.fromtimestamp(nowms/1000.))
|
---|
Note:
See
TracBrowser
for help on using the repository browser.