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

Bugz collector #62

Merged
merged 2 commits into from
Dec 3, 2017
Merged

Bugz collector #62

merged 2 commits into from
Dec 3, 2017

Conversation

snth
Copy link
Owner

@snth snth commented Dec 2, 2017

Fixes Collector handling of filters and types and adds pattern matching for subscriptions.

@barrysteyn please review

@@ -262,39 +262,43 @@ def subscribe(state, feed, exchange, assets, currencies, interval, channels):


@coin.command()
@click.option('--market', '-m', default='all')
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call. I thought this was getting too complicated.

type=click.Choice(['None', 'Trade', 'Heartbeat', 'LimitOrder',
'CancelOrder']))
@click.option('--filters', '-f', default=None, type=str, multiple=True)
# FIXME: the types should be autogenerated from the Event types
Copy link
Contributor

Choose a reason for hiding this comment

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

That would be cool... but it may also seem like magic...

Copy link
Owner Author

Choose a reason for hiding this comment

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

Perhaps, but we currently do the same for Feeds and Collectors. That's one of the nice things because you just have to register a new Feed and the CLI help output updates automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know, that also seems like magic. The things I have against magic is that takes more time to understand how the infrastructure works as opposed to what it does. This is not to say it's always bad, but often times, it leads to over engineering...

Copy link
Owner Author

Choose a reason for hiding this comment

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

That's true.

@click.option('--text', 'format', flag_value='text', default=True)
@click.option('--json', 'format', flag_value='json')
@click.option('--interval', '-i', default=None, type=float)
@pass_state
def collect(state, market, stream, collector, filter, type, output, format, interval):
def collect(state, subscriptions, stream, collector, output, filters, types, format,
Copy link
Contributor

Choose a reason for hiding this comment

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

Collect sure has a long argument list...

Copy link
Contributor

@barrysteyn barrysteyn left a comment

Choose a reason for hiding this comment

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

LGTM

This is working nicely now on Poloniex, and I definitely noticed this problem in the past

@snth snth merged commit 9039fca into master Dec 3, 2017
@snth
Copy link
Owner Author

snth commented Dec 3, 2017

The problem was that at some point I changed the order of the decorators but hadn't adjusted the order of the arguments so options were sent to the wrong arguments.

@snth snth deleted the bugz_collector branch December 3, 2017 05:08
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.

2 participants