-
Notifications
You must be signed in to change notification settings - Fork 8
/
tv_grab_test_source.py
executable file
·38 lines (29 loc) · 980 Bytes
/
tv_grab_test_source.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Python 3 compatibility
from __future__ import unicode_literals
# from __future__ import print_function
# Modules we need
#~ import sys, locale, traceback, json
#~ import time, datetime, pytz
import sys, locale
from tvgrabpyAPI import tv_grab_IO, version
try:
unichr(42)
except NameError:
unichr = chr # Python 3
# check Python version
if sys.version_info[:3] < (2,7,9):
sys.stderr.write("tv_grab_nl_API requires Pyton 2.7.9 or higher\n")
sys.exit(2)
if sys.version_info[:2] >= (3,0):
sys.stderr.write("tv_grab_nl_API does not yet support Pyton 3 or higher.\nExpect errors while we proceed\n")
locale.setlocale(locale.LC_ALL, '')
if version()[1:4] < (1,0,7):
sys.stderr.write("tv_grab_nl3_py requires tv_grab_nl_API 1.0.7 or higher\n")
sys.exit(2)
if __name__ == '__main__':
test_source = tv_grab_IO.test_Source()
x = test_source.test_source()
test_source.close()
sys.exit(x)