Skip to content

Instantly share code, notes, and snippets.

View y10h's full-sized avatar

Yury Yurevich y10h

  • San Francisco Bay Area
View GitHub Profile
@y10h
y10h / db.py
Created May 4, 2009 11:41
fixture wanted
"""
db -- provides database schema
"""
import sqlalchemy as sa
metadata = sa.MetaData()
kladr = sa.Table('kladr', metadata,
sa.Column('na_me', sa.Unicode(40)),
sa.Column('socr', sa.Unicode(10)),
@y10h
y10h / dbf2sa.py
Created May 14, 2009 09:32
dbf->rdbms using ydbf and sqlalchemy
#!/usr/bin/env python
"""
Move DBF data (as single table) to RDBMS using SQLAlchemy
"""
import os
import ydbf
import sqlalchemy as sa
#!/usr/bin/env python
# 2009 Yury Yurevich <anarresti@altlinux.org>, <the.pythy@gmail.com>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@y10h
y10h / logg.py
Created October 6, 2009 12:38
Auto-naming loggers
# encoding: utf-8
"""
Logging facilities
"""
import sys
import logging
FUNC_LOGGERS = {}
MOD_LOGGERS = {}
"""Security enchancement middleware
Allows to use `public` decorator for few public views instead of
`login_required` for almost everything.
Maybe we should contribute this to Django -Alex
(c) Alex Lebedev <me@alexlebedev.com>, Februray 2009
"""
import re
class Base(object):
def __init__(self, x):
print "Base - %s" % x
class Inherited(Base):
def __init__(self):
super(Inherited, self).__init__('foo')
print "Inherited"
o = Inherited()
# hg redirections
redirects = {
'/': 'http://github.com/j2a',
'byteflow-pyo': 'http://bitbucket.org/j2a/pyo-byteflow',
'pytils': 'http://github.com/j2a/pytils',
'ydbf': 'http://github.com/j2a/ydbf',
'zepto': 'http://bitbucket.org/j2a/zepto',
}
import urlparse
#!/usr/bin/env python
import os
import sys
import time
import signal
def show(sig, frame):
print "got signal %s" % sig
def exit(sig, frame):
$ git clone git://github.com/ask/celery.git
$ sloccount celery/celery | grep "Source Lines of Code"
Total Physical Source Lines of Code (SLOC) = 15,771
$ rm -rf celery/celery/tests
$ sloccount celery/celery | grep "Source Lines of Code"
Total Physical Source Lines of Code (SLOC) = 10,204
diff --git a/django_jenkins/tasks/with_coverage.py b/django_jenkins/tasks/with_coverage.py
index 716d269..29c234c 100644
--- a/django_jenkins/tasks/with_coverage.py
+++ b/django_jenkins/tasks/with_coverage.py
@@ -29,7 +29,7 @@ class Task(BaseTask):
super(Task, self).__init__(test_labels, options)
self.test_apps = get_apps_under_test(test_labels, options['test_all'])
self.output_dir = options['output_dir']
- self.excludes = options['coverage_excludes']
+ self.excludes = options['coverage_excludes'] or [os.environ['DJANGO_SETTINGS_MODULE']]