This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Subscribe to my own repo's events as me | |
| # This succeeds with a 204. | |
| curl -u "ralphbean" -i \ | |
| https://api.github.com/hub \ | |
| -F "hub.mode=subscribe" \ | |
| -F "hub.topic=https://github.com/ralphbean/pyrasite/events/push" \ | |
| -F "hub.callback=http://requestb.in/wxgbx8wx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkvirtualenv my_virtualenv | |
| git clone git://github.com/ralphbean/fedmsg.git | |
| cd fedmsg | |
| python setup.py develop | |
| cd .. | |
| mkdir my_consumer_project | |
| cd my_consumer_project | |
| # First copy my_consumer.py and setup.py from this gist into this directory. | |
| # Then copy the development fedmsg config from the other git clone like this | |
| cp -rf ../fedmsg/fedmsg.d/ . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Surprised to find that the '__' in python has semantic meaning. | |
| Tested in python-2.7 and python-3.2. | |
| """ | |
| class MyClass(object): | |
| _with_single_under = False | |
| __with_double_unders = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [moksha.hub] INFO 2012-08-04 19:47:57,938 Loading the Moksha Hub | |
| [moksha.hub] INFO 2012-08-04 19:47:57,938 Loading Consumers | |
| [moksha.hub] INFO 2012-08-04 19:47:57,938 RelayConsumer consumer is watching the 'org.fedoraproject.*' topic | |
| [moksha.hub] INFO 2012-08-04 19:47:57,939 Binding publish socket to 'tcp://app01.phx2.fedoraproject.org:3999' | |
| [moksha.hub] INFO 2012-08-04 19:47:58,056 Resolving app01.phx2.fedoraproject.org to ['10.5.126.31'] | |
| [moksha.hub] INFO 2012-08-04 19:47:58,134 Resolving app01.phx2.fedoraproject.org to ['10.5.126.31'] | |
| [moksha.hub] INFO 2012-08-04 19:47:59,135 Subscribing to org.fedoraproject. on 'ZmqEndpoint(type='bind', address='tcp://10.5.126.31:3998')' | |
| [moksha.hub] INFO 2012-08-04 19:47:59,136 Loading Producers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tw2.core as twc | |
| import tw2.forms as twf | |
| class SettingsForm(twf.Form): | |
| submit = twf.SubmitButton(value='Update') | |
| action = '/update_settings' | |
| class child(twf.TableLayout): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Script to do some math to make an educated guess at | |
| bandwith requirements of fedmsg for Fedora Infrastructure. | |
| :: | |
| --- ~/scratch » python message-size.py | |
| kbps: 6.49658203125 | |
| mbps: 0.00634431838989 | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/fas/validators.py b/fas/validators.py | |
| index 5a6db4f..d5391f2 100644 | |
| --- a/fas/validators.py | |
| +++ b/fas/validators.py | |
| @@ -181,7 +181,10 @@ class ValidSSHKey(validators.FancyValidator): | |
| def _to_python(self, value, state): | |
| # pylint: disable-msg=C0111,W0613 | |
| - return value.file.read().decode('utf-8') | |
| + if isinstance(value, unicode): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ Print a list of the contributors whose names have appeared in any event | |
| in the last 60 days | |
| """ | |
| __requires__ = 'datanommer==0.1.8' | |
| import sys | |
| from pkg_resources import load_entry_point | |
| import datanommer.models as m | |
| import fedmsg.config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| ''' | |
| Created on 13.04.2012 | |
| Ported to tw2 on 25.05.2012 | |
| @author: moschlar | |
| ''' | |
| import tw2.core as twc | |
| import tw2.forms as twf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| ''' | |
| Created on 13.04.2012 | |
| Ported to tw2 on 25.05.2012 | |
| @author: moschlar | |
| ''' | |
| import tw2.core as twc | |
| import tw2.forms as twf |