mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-23 03:33:24 +00:00
Added support for 24 hour time entires in xml.
This commit is contained in:
@@ -168,6 +168,24 @@ class PseudoChannel():
|
|||||||
bar_length = 40
|
bar_length = 40
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def interpret_time_input(self, input):
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
return datetime.datetime.strptime(time.text, '%I:%M %p')
|
||||||
|
|
||||||
|
except:
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
return datetime.datetime.strptime(time.text, '%H:%M')
|
||||||
|
|
||||||
|
except:
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
def update_schedule(self):
|
def update_schedule(self):
|
||||||
|
|
||||||
self.db.create_tables()
|
self.db.create_tables()
|
||||||
@@ -224,7 +242,9 @@ class PseudoChannel():
|
|||||||
|
|
||||||
overlap_max = time.attrib['overlap-max']
|
overlap_max = time.attrib['overlap-max']
|
||||||
|
|
||||||
start_time_unix = datetime.datetime.strptime(time.text, '%I:%M %p')
|
#start_time_unix = datetime.datetime.strptime(time.text, '%I:%M %p')
|
||||||
|
|
||||||
|
start_time_unix = self.interpret_time_input(time.text)
|
||||||
|
|
||||||
print "Adding: ", time.tag, section, time.text, time.attrib['title']
|
print "Adding: ", time.tag, section, time.text, time.attrib['title']
|
||||||
|
|
||||||
@@ -454,7 +474,6 @@ class PseudoChannel():
|
|||||||
if entry[3] == "random":
|
if entry[3] == "random":
|
||||||
|
|
||||||
the_movie = self.db.get_random_movie()
|
the_movie = self.db.get_random_movie()
|
||||||
print("here")
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user