Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.pyc
AUTHORS
ChangeLog
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Edward Toroshchin <chukchi-project@hades.name> Edward Hades <chukchi-project@hades.name>
1 change: 0 additions & 1 deletion AUTHORS

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include chuckchi/api/static *
1 change: 0 additions & 1 deletion chukchi/api/static

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions chukchi/cmd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import logging
import sys

def run():
from chukchi.api import app
print __file__
print sys.modules['chukchi'].__file__
logging.basicConfig(format="%(asctime)-15s %(name)s: %(message)s",
level=logging.DEBUG if app.debug else logging.INFO)
app.run(*sys.argv[1:])

def init_db():
from chukchi.db import engine
from chukchi.db.models import Base

Base.metadata.create_all(engine)

def update_feeds():
from datetime import timedelta

from sqlalchemy.orm import scoped_session

from chukchi.config import config
from chukchi.db import Session
from chukchi.db.models import Feed
from chukchi.feed.parse import update_feed
from chukchi.utils import now

logging.basicConfig(level=logging.DEBUG if config.DEBUG else logging.INFO)

LOG = logging.getLogger(__name__)

db_search = Session()
db_update = scoped_session(Session)

if config.SOCKET_TIMEOUT:
import socket
socket.setdefaulttimeout(config.SOCKET_TIMEOUT)

for feed in db_search.query(Feed).filter( Feed.active == True,
Feed.retrieved_at <= (now() - timedelta(**config.UPDATE_DELAY)) ):
feed_repr = repr(feed)
try:
db_search.expunge(feed)
update_feed(db_update, feed=feed)
db_update.commit()
except Exception, e:
LOG.exception("failure updating feed %s", feed_repr)
db_update.remove()
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Flask>=0.8
Flask-OpenID>=1.1.1
SQLAlchemy>=0.7.9
feedparser>=5.1.2
pytz
Empty file removed scripts/__init__.py
Empty file.
23 changes: 0 additions & 23 deletions scripts/init_db.py

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/run.py

This file was deleted.

53 changes: 0 additions & 53 deletions scripts/update_feeds.py

This file was deleted.

29 changes: 29 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[metadata]
name = chukchi
summary = Chukchi is an RSS aggregation webapp
description-file =
README
author = Edward Toroshchin
author-email = chukchi-project@hades.name
classifier =
Development Status :: 3 - Alpha
Environment :: Web Environment
Framework :: Flask
License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Operating System :: OS Independent
Programming Language :: Python :: 2 :: Only

[global]
setup-hooks =
pbr.hooks.setup_hook

[files]
packages =
chukchi
include_package_data = True

[entry_points]
console_scripts =
chukchi-init-db = chukchi.cmd:init_db
chukchi-run = chukchi.cmd:run
chukchi-update-feeds = chukchi.cmd:update_feeds
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import setuptools

setuptools.setup(
setup_requires=['d2to1>=0.2.10,<0.3', 'pbr>=0.5,<0.6'],
d2to1=True)