Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for custom tags #130

Merged
merged 1 commit into from
Jan 28, 2019

Conversation

mauricioabreu
Copy link
Member

Main parser function now receives a function that can be
used to parse the line content and save it into the data store object.

@coveralls
Copy link

coveralls commented Jan 28, 2019

Coverage Status

Coverage decreased (-0.8%) to 96.353% when pulling 5f40195 on mauricioabreu:parse-custom-tags into 6cbe1e5 on globocom:master.

@mauricioabreu
Copy link
Member Author

I have another idea here: we can add the "ignored" tags in a new data structure, containing the line, lineno and any other useful information that can be directly used by m3u8 users after they parse the content.

...
        elif line.startswith('#'):
            data['ignored_lines'] = {'line': line, 'lineno': lineno}
...

# Usage
m3u8_obj = m3u8.loads('#EXTM3U8 ... etc ... ')
data = post_process_data(m3u8_obj.data)

tests/test_parser.py Outdated Show resolved Hide resolved
Main parser function now receives a function that can be
used to parse the line content and save it into the data store object.
@leandromoreira
Copy link
Contributor

LGTM and solves #123 and #124 does all the tests pass locally @mauricioabreu ? I tried to restart the build manually but the same error happened

 Plugin 'pytest_cov' could not be loaded:

Copy link
Contributor

@leandromoreira leandromoreira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix build

@mauricioabreu
Copy link
Member Author

@leandromoreira I was reading about this error and it seems to be incompatibility of python version vs pytest_cov plugin. One way to solve this issue is using tox: https://tox.readthedocs.io/en/latest/

@mauricioabreu
Copy link
Member Author

Python 3.5 and Python 2.6 passed the test suite: https://travis-ci.org/globocom/m3u8/builds/485545837?utm_source=github_status&utm_medium=notification

@leandromoreira
Copy link
Contributor

so I'll merge it and then I'll try to use this tox thing.

@leandromoreira leandromoreira merged commit 54f3655 into globocom:master Jan 28, 2019
@mauricioabreu mauricioabreu deleted the parse-custom-tags branch January 29, 2019 00:01
@mauricioabreu
Copy link
Member Author

@leandromoreira we don't pin versions of any dependence. Recently pytest_cov deprecated some python versions as we can see here: https://github.com/pytest-dev/pytest-cov/blob/master/setup.py#L127

python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'

Maybe tox can help us to define different dependency versions for different python versions.

@leandromoreira
Copy link
Contributor

We should do this.

@leandromoreira
Copy link
Contributor

good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants