Skip to content

Commit 63db093

Browse files
Fix tests (#303)
1 parent 927599a commit 63db093

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ disable=
1818
too-many-statements,
1919
use-maxsplit-arg,
2020
consider-using-from-import,
21+
unspecified-encoding,
2122

2223
super-with-arguments, # Python 2.7 compatibility
2324
raise-missing-from, # Python 2.7 compatibility

resources/lib/modules/iptvmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def send_channels(self):
7070
@via_socket
7171
def send_epg(self):
7272
""" Report EPG data """
73-
results = dict()
73+
results = {}
7474

7575
# Fetch EPG data
7676
for date in ['yesterday', 'today', 'tomorrow']:

resources/lib/vtmgo/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _request(method, url, params=None, form=None, data=None, token=None, profile
147147
"""
148148
if form or data:
149149
# Make sure we don't log the password
150-
debug_data = dict()
150+
debug_data = {}
151151
debug_data.update(form or data)
152152
if 'password' in debug_data:
153153
debug_data['password'] = '**redacted**'

resources/lib/vtmgo/vtmgostream.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _extract_subtitles_from_stream_info(stream_info):
162162
:type stream_info: dict
163163
:rtype list[dict]
164164
"""
165-
subtitles = list()
165+
subtitles = []
166166
if stream_info.get('video').get('subtitles'):
167167
for _, subtitle in enumerate(stream_info.get('video').get('subtitles')):
168168
name = subtitle.get('language')
@@ -191,7 +191,7 @@ def _download_subtitles(subtitles):
191191
if not kodiutils.exists(temp_dir):
192192
kodiutils.mkdirs(temp_dir)
193193

194-
downloaded_subtitles = list()
194+
downloaded_subtitles = []
195195
for subtitle in subtitles:
196196
output_file = temp_dir + subtitle.get('name')
197197
webvtt_content = util.http_get(subtitle.get('url')).text
@@ -207,7 +207,7 @@ def _delay_webvtt_timing(match, ad_breaks):
207207
:type ad_breaks: list[dict]
208208
:rtype str
209209
"""
210-
sub_timings = list()
210+
sub_timings = []
211211
for timestamp in match.groups():
212212
hours, minutes, seconds, millis = (int(x) for x in [timestamp[:-10], timestamp[-9:-7], timestamp[-6:-4], timestamp[-3:]])
213213
sub_timings.append(timedelta(hours=hours, minutes=minutes, seconds=seconds, milliseconds=millis))
@@ -247,8 +247,8 @@ def _download_and_delay_subtitles(self, subtitles, json_manifest):
247247
if not kodiutils.exists(temp_dir):
248248
kodiutils.mkdirs(temp_dir)
249249

250-
ad_breaks = list()
251-
delayed_subtitles = list()
250+
ad_breaks = []
251+
delayed_subtitles = []
252252
webvtt_timing_regex = re.compile(r'\n(\d{2}:\d{2}:\d{2}\.\d{3}) --> (\d{2}:\d{2}:\d{2}\.\d{3})\s')
253253

254254
# Get advertising breaks info from json manifest

0 commit comments

Comments
 (0)