Set up a call context to pass local and remote address during session start-up #10

Merged
merged 2 commits into from May 29, 2013

Conversation

Projects
None yet
2 participants
Contributor

allenap commented Nov 15, 2012

We have a situation where we want to know both the local and remote addresses in the IBackend. I've used twisted.python.context to achieve this. This change set is working well for us.

Contributor

allenap commented May 21, 2013

shylent, can you look at this? Fwiw, python-tx-tftp in Ubuntu (12.10 and after, proposed for 12.04) ships with this patch.

tftp/test/test_protocol.py
+
+ def __init__(self, args, names):
+ super(CapturedContext, self).__init__(*args)
+ self.context = {name: context.get(name) for name in names}
@shylent

shylent May 25, 2013

Owner

Please, lose the dict comprehension, since that prevents the code from running on pre-2.7 python

Owner

shylent commented May 25, 2013

Except for the dictcomp, that I've mentioned in the comments, this is ready to be merged.

Contributor

allenap commented May 28, 2013

Dict comprehension removed, please merge away :) Thanks!

Owner

shylent commented May 29, 2013

Thanks a lot. I will rerun the tests and merge the branch later this day.

shylent added a commit that referenced this pull request May 29, 2013

@shylent shylent merged commit e605d64 into shylent:master May 29, 2013

@allenap allenap deleted the allenap:request-context branch Feb 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment