# Path: feedplatform/addins.py
# class base(object):
#     class __metaclass__(type):
#         def __new__(cls, name, bases, attrs):
#     def __new__(cls, *args, **kwargs):
#     def setup(self):
#     def log(self):
# def get_addins():
# def _make_addin(addin):
# def reinstall(addins=None):
#         def resolve_dependencies(addin, index):
# def install(*args, **kwargs):
# _ADDINS = None
#     _ADDINS = to_be_setup
# 
# Path: feedplatform/db.py
# class MultipleObjectsReturned(Exception):
# class DatabaseProxy(object):
# class ModelsProxy(types.ModuleType):
# def get_one(result):
# def cap_model_name(name):
#     def repl(m):
# def uncap_model_name(name):
#     def __init__(self, create_func):
#     def _connect(self):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __init__(self):
#     def __getattr__(self, name):
#     def __iter__(self):
#     def iternames(self):
#     def iteritems(self):
#     def _construct_models(self):
# def reconfigure():
# BASE_MODELS = {
#     'feed': {
#         'id': (Int, (), {'primary': True}),
#         'url': (Unicode, (), {}),
#         'items': (ReferenceSet, ('Feed.id', 'Item.feed_id',), {}),
#     },
#     'item': {
#         'id': (Int, (), {'primary': True}),
#         'feed_id': (Int, (), {}),
#         'feed': (Reference, ('feed_id', 'Feed.id',), {}),
#         'guid': (Unicode, (), {}),
#     },
# }
# 
# Path: feedplatform/util.py
# def struct_to_datetime(structt):
#     """Convert timestructs/9-tuples, as returned by feedparser, to
#     naive, UTC-based datetime objects.
# 
#     See also:
#         http://www.deadlybloodyserious.com/2007/09/feedparser-v-django/
#         http://www.intertwingly.net/blog/2007/09/02/Dealing-With-Dates
#     """
#     if not structt:
#         return structt
#     return datetime.datetime.utcfromtimestamp(calendar.timegm(structt))


from datetime import datetime
from storm.locals import Unicode, DateTime
from feedplatform import addins
from feedplatform import db
from feedplatform.util import struct_to_datetime

    ``standard_fields`` attributes, and may implement ``_get_value``
    for additional processing.

    ``standard_fields`` should be a dict in the form (name => field),
    with ``field`` being a database field instance or creation tuple,
    and name being both the model column name and the key name to use
    when reading the value from the feed parser source dict. If you
    want the model field name to differ from the source field, you may
    specifiy a dict for ``field``:

        'href': {'target': 'image_href', 'field': (Unicode, (), {})}

    See also ``collect_feed_data`` and other subclasses for information
    about how these collectors can be called and used from the end-user
    perspective - much of that functionality is implemented here in the
    base class.
    """

    abstract = True

    USE_DEFAULT = object()

    # provide in subclass
    model_name = None
    standard_fields = None
    date_fields = None

    # Provide special fields that every subclass supports.
    class __metaclass__(type(addins.base)):
        def __new__(cls, name, bases, attrs):

# Path: feedplatform/addins.py
# class base(object):
#     class __metaclass__(type):
#         def __new__(cls, name, bases, attrs):
#     def __new__(cls, *args, **kwargs):
#     def setup(self):
#     def log(self):
# def get_addins():
# def _make_addin(addin):
# def reinstall(addins=None):
#         def resolve_dependencies(addin, index):
# def install(*args, **kwargs):
# _ADDINS = None
#     _ADDINS = to_be_setup
# 
# Path: feedplatform/db.py
# class MultipleObjectsReturned(Exception):
# class DatabaseProxy(object):
# class ModelsProxy(types.ModuleType):
# def get_one(result):
# def cap_model_name(name):
#     def repl(m):
# def uncap_model_name(name):
#     def __init__(self, create_func):
#     def _connect(self):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __init__(self):
#     def __getattr__(self, name):
#     def __iter__(self):
#     def iternames(self):
#     def iteritems(self):
#     def _construct_models(self):
# def reconfigure():
# BASE_MODELS = {
#     'feed': {
#         'id': (Int, (), {'primary': True}),
#         'url': (Unicode, (), {}),
#         'items': (ReferenceSet, ('Feed.id', 'Item.feed_id',), {}),
#     },
#     'item': {
#         'id': (Int, (), {'primary': True}),
#         'feed_id': (Int, (), {}),
#         'feed': (Reference, ('feed_id', 'Feed.id',), {}),
#         'guid': (Unicode, (), {}),
#     },
# }
# 
# Path: feedplatform/util.py
# def struct_to_datetime(structt):
#     """Convert timestructs/9-tuples, as returned by feedparser, to
#     naive, UTC-based datetime objects.
# 
#     See also:
#         http://www.deadlybloodyserious.com/2007/09/feedparser-v-django/
#         http://www.intertwingly.net/blog/2007/09/02/Dealing-With-Dates
#     """
#     if not structt:
#         return structt
#     return datetime.datetime.utcfromtimestamp(calendar.timegm(structt))


# Path: feedplatform/lib/addins/feeds/collect_feed_data.py
from datetime import datetime
from storm.locals import Unicode, DateTime
from feedplatform import addins
from feedplatform import db
from feedplatform.util import struct_to_datetime

    ``standard_fields`` attributes, and may implement ``_get_value``
    for additional processing.

    ``standard_fields`` should be a dict in the form (name => field),
    with ``field`` being a database field instance or creation tuple,
    and name being both the model column name and the key name to use
    when reading the value from the feed parser source dict. If you
    want the model field name to differ from the source field, you may
    specifiy a dict for ``field``:

        'href': {'target': 'image_href', 'field': (Unicode, (), {})}

    See also ``collect_feed_data`` and other subclasses for information
    about how these collectors can be called and used from the end-user
    perspective - much of that functionality is implemented here in the
    base class.
    """

    abstract = True

    USE_DEFAULT = object()

    # provide in subclass
    model_name = None
    standard_fields = None
    date_fields = None

    # Provide special fields that every subclass supports.
    class __metaclass__(type(addins.base)):
        def __new__(cls, name, bases, attrs):

            result = type(addins.base).__new__(cls, name, bases, attrs)
