Fix setup.py
This commit is contained in:
@@ -26,7 +26,8 @@ class Parser:
|
|||||||
if jsn is None:
|
if jsn is None:
|
||||||
raise ChatParseException('Called with none JSON object.')
|
raise ChatParseException('Called with none JSON object.')
|
||||||
if jsn['response']['responseContext'].get('errors'):
|
if jsn['response']['responseContext'].get('errors'):
|
||||||
raise ResponseContextError('The video_id would be wrong, or video is deleted or private.')
|
raise ResponseContextError('The video_id would be wrong,'
|
||||||
|
'or video is deleted or private.')
|
||||||
contents=jsn['response'].get('continuationContents')
|
contents=jsn['response'].get('continuationContents')
|
||||||
return contents
|
return contents
|
||||||
|
|
||||||
@@ -77,7 +78,8 @@ class Parser:
|
|||||||
metadata.setdefault("timeoutMs",interval)
|
metadata.setdefault("timeoutMs",interval)
|
||||||
"""Archived chat has different structures than live chat,
|
"""Archived chat has different structures than live chat,
|
||||||
so make it the same format."""
|
so make it the same format."""
|
||||||
chatdata = [action["replayChatItemAction"]["actions"][0] for action in actions]
|
chatdata = [action["replayChatItemAction"]["actions"][0]
|
||||||
|
for action in actions]
|
||||||
else:
|
else:
|
||||||
metadata.setdefault('timeoutMs', 10000)
|
metadata.setdefault('timeoutMs', 10000)
|
||||||
chatdata = actions
|
chatdata = actions
|
||||||
|
|||||||
6
setup.py
6
setup.py
@@ -1,7 +1,7 @@
|
|||||||
from setuptools import setup, find_packages, Command
|
from setuptools import setup, find_packages, Command
|
||||||
#from codecs import open as open_c
|
#from codecs import open as open_c
|
||||||
from os import path, system, remove, rename
|
from os import path, system, remove, rename, removedirs
|
||||||
import re
|
import re, shutil
|
||||||
|
|
||||||
package_name = "pytchat"
|
package_name = "pytchat"
|
||||||
|
|
||||||
@@ -13,6 +13,8 @@ def _requirements():
|
|||||||
def _test_requirements():
|
def _test_requirements():
|
||||||
return [name.rstrip() for name in open(path.join(root_dir, 'requirements_test.txt')).readlines()]
|
return [name.rstrip() for name in open(path.join(root_dir, 'requirements_test.txt')).readlines()]
|
||||||
|
|
||||||
|
shutil.rmtree('build/')
|
||||||
|
shutil.rmtree('dist/')
|
||||||
|
|
||||||
with open(path.join(root_dir, package_name, '__init__.py')) as f:
|
with open(path.join(root_dir, package_name, '__init__.py')) as f:
|
||||||
init_text = f.read()
|
init_text = f.read()
|
||||||
|
|||||||
Reference in New Issue
Block a user