Skip to content

Instantly share code, notes, and snippets.

View ralphbean's full-sized avatar

Ralph Bean ralphbean

  • Red Hat, Inc
  • Rochester, NY
View GitHub Profile
@ralphbean
ralphbean / upstream-checkery.py
Created May 3, 2012 01:20
List the Fedora packages I own by their status in Upstream Release Monitoring.
#!/usr/bin/env python
"""
List the Fedora packages I own by their status in Upstream Release Monitoring.
Requires a few python modules::
$ sudo yum install python-fedora python-keyring python-vault
If you couldn't get python-vault, that's because it's not in F17 yet. Try::
@ralphbean
ralphbean / search-example.py
Created May 14, 2012 15:27
An example of searching for packages against the new fedora-packages app
#!/usr/bin/env python
import pprint
import json
import urllib
BASE_URL = "https://apps.fedoraproject.org/packages/" + \
"fcomm_connector/xapian/query/search_packages/"
query_params = {
@ralphbean
ralphbean / instructions.txt
Created May 21, 2012 18:17
Instructions to check out the moksha demo dashboard with moksha>=0.8.0
# Copy/paste the following into a term
VENV=testing-moksha
rmvirtualenv $VENV
mkvirtualenv $VENV
pip install mdemos.all
# Grab some configs
wget https://raw.github.com/ralphbean/mdemos.server/master/development.ini
wget https://raw.github.com/ralphbean/mdemos.server/master/orbited.cfg
def prepare(self):
super(SubmissionForm, self).prepare()
self.safe_modify('c')
self.c.language_id = self.c.language_id(options=[
(lang.id, lang.name)
for lang in DBSession.query(Assignment)\
.get(self.assignment_id.value).allowed_languages
])
# -*- coding: utf-8 -*-
'''
Created on 17.03.2012
Ported to tw2 on 25.05.2012
@author: moschlar
'''
import tw2.core as twc
import tw2.forms as twf
@ralphbean
ralphbean / samples.py
Created May 27, 2012 03:35
An attempt to invalidate the form in samples.py
"""
Here you can create samples of your widgets by providing default parameters,
inserting them in a container widget, mixing them with other widgets, etc...
These samples will appear in the WidgetBrowser
See http://toscawidgets.org/documentation/WidgetBrowser for more information
"""
import tw2.core as twc
from tw2.forms.samples import DemoChildren
@ralphbean
ralphbean / color-paste.sh
Created May 29, 2012 15:29
Script to upload little stdout blurbs.
#!/bin/bash
# Script to take the output of commands and post them to a tmp web directory
# for easy sharing. Requires python-ansi2html.
#
# Author: Ralph Bean <[email protected]>
# License: GPLv3+
# Edit the following three variables to suit your needs
WEB_USER=your_username
WEB_HOST=your_site.org
@ralphbean
ralphbean / submission.py
Created May 30, 2012 20:48 — forked from moschlar/submission.py
A ToscaWidgets2 widget that needs a dynamic SelectField and does not work :(
# -*- coding: utf-8 -*-
'''
Created on 17.03.2012
@author: moschlar
'''
import tw2.core as twc
import tw2.forms as twf
import tw2.sqla as twsa
# -*- coding: utf-8 -*-
'''
Created on 17.03.2012
@author: moschlar
'''
import tw2.core as twc
import tw2.forms as twf
import tw2.sqla as twsa
@ralphbean
ralphbean / test_site.py
Created June 14, 2012 14:41 — forked from moschlar/test_site.py
Test multiple sites
from sauce.tests import TestController
__all__ = ['TestSite']
class TestSite(TestController):
sites = ['/', '/about', '/contact']
def _do_site(self, site):
response = self.app.get(site)