1
# OpenShot Video Editor is a program that creates, modifies, and edits video files.
2
# Copyright (C) 2009 Jonathan Thomas
4
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
6
# OpenShot Video Editor is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# OpenShot Video Editor is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with OpenShot Video Editor. If not, see <http://www.gnu.org/licenses/>.
22
"""This class contains methods to simply displaying time codes"""
24
#----------------------------------------------------------------------
29
def get_friendly_time(self, milli):
30
"""Convert milliseconds to a tuple of the common time"""
31
sec, milli = divmod(milli, 1000)
32
min, sec = divmod(sec, 60)
33
hour, min = divmod(min, 60)
34
day, hour = divmod(hour, 24)
35
week, day = divmod(day, 7)
37
return (week, day, hour, min, sec, int(milli))
b'\\ No newline at end of file'