Skip to content

Instantly share code, notes, and snippets.

@EliAndrewC
EliAndrewC / config_dump.py
Created April 26, 2015 04:47
Result of "sep print_config"
{'admin_email': 'Eli Courtwright <eli@courtwright.org>',
'age_groups': {'age_unknown': {'can_register': True,
'can_volunteer': True,
'consent_form': False,
'desc': 'age unknown',
'discount': 0,
'wristband_color': ''},
'over_21': {'can_register': True,
'can_volunteer': True,
@EliAndrewC
EliAndrewC / syslog
Created September 23, 2014 03:35
Traceback from syslog for group member registration error
Sep 22 10:20:19 prime 2014-09-22 10:20:19,244 [ERROR] cherrypy.error.140059498634376: [22/Sep/2014:10:20:19] HTTP Traceback (most recent call last):
File "/usr/local/uber13/env/lib/python3.4/site-packages/SQLAlchemy-0.8.5-py3.4.egg/sqlalchemy/engine/base.py", line 867, in _execute_context
context)
File "/usr/local/uber13/env/lib/python3.4/site-packages/SQLAlchemy-0.8.5-py3.4.egg/sqlalchemy/engine/default.py", line 326, in do_execute
cursor.execute(statement, parameters)
psycopg2.DataError: invalid input syntax for uuid: "None"
LINE 3: WHERE "group".id = 'None'
^
The above exception was the direct cause of the following exception:
@EliAndrewC
EliAndrewC / dump_staffers.py
Created July 29, 2014 01:58
Import script for getting M12 staffers into M13 database
from common import *
import constants
from custom_tags import time_day
uninvited = [] # redacted for public gist
val2name = {}
for _name, _val in constants.__dict__.items():
if re.match('^[_A-Z0-9]+$', _name) and isinstance(_val, int):
val2name[_val] = _name
@EliAndrewC
EliAndrewC / gist:953ee594ca4a46e17a92
Created July 2, 2014 20:57
some paver packaging stuff
import time
import os
import re
import shutil
import warnings
from ConfigParser import SafeConfigParser, NoOptionError
import pkg_resources
from paver.path import path
@EliAndrewC
EliAndrewC / gist:10328292
Created April 9, 2014 23:08
Sideboard RPM specfile
# We are assuming EL5 (<EL5 is not supported), since we don't have EL6 python27 packages yet.
%define __python_pkgname python27
%define __python_exe python2.7
# Override the global %{__python} macro to point to our own python version
%define __python %{_bindir}/%{__python_exe}
# Specify the distribute package to use
%define setuptools_package python27-distribute
# This is the "package name" that we use in naming the /etc, /var/run, /var/log, subdirs.
%define PACKAGE sideboard