mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 19:40:21 +01:00
added EXIF patch and misc in lib
removed some cruft
This commit is contained in:
22
src/lib/misc.py
Normal file
22
src/lib/misc.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Project: pyGTKtalog
|
||||
Description: Misc functions used more than once in src
|
||||
Type: lib
|
||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||
Created: 2008-12-15
|
||||
"""
|
||||
|
||||
def float_to_string(float_length):
|
||||
"""
|
||||
Parse float digit into time string
|
||||
Arguments:
|
||||
@string - width of generated image. If actual image width
|
||||
exceeds this number scale is performed.
|
||||
Returns HH:MM:SS formatted string
|
||||
"""
|
||||
hour = int(float_length / 3600);
|
||||
float_length -= hour*3600
|
||||
minutes = int(float_length / 60)
|
||||
float_length -= minutes * 60
|
||||
sec = int(float_length)
|
||||
return "%02d:%02d:%02d" % (hour, minutes, sec)
|
||||
Reference in New Issue
Block a user