This file contains 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 | |
import urllib, simplejson | |
def is_github_project(href): | |
"Quick and dirty way to find if a link is a github project" | |
if href.startswith("http://github.com") and len(href.split("/")) == 5: | |
return True | |
return False | |
def get_popular_projects(): |
This file contains 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
class DeclarativeFieldsMetaclass(type): | |
""" | |
Metaclass that converts Field attributes to a dictionary called | |
'base_fields', taking into account parent class 'base_fields' as well. | |
""" | |
def __new__(cls, name, bases, attrs): | |
attrs['base_fields'] = get_declared_fields(bases, attrs) | |
new_class = super(DeclarativeFieldsMetaclass, | |
cls).__new__(cls, name, bases, attrs) | |
if 'media' not in attrs: |
NewerOlder