Skip to content

Commit

Permalink
Merge pull request #73 from scrapinghub/sqlalchemy-backend-rename
Browse files Browse the repository at this point in the history
Renaming SQLiteBackend to SQLAlchemyBackend
  • Loading branch information
sibiryakov committed Sep 29, 2015
2 parents bcffc3c + 96e67d7 commit 8d1baea
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions frontera/contrib/backends/sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __repr__(self):
return '<Page:%s>' % self.url


class SQLiteBackend(Backend):
component_name = 'SQLite Backend'
class SQLAlchemyBackend(Backend):
component_name = 'SQLAlchemy Backend'

def __init__(self, manager):
self.manager = manager
Expand Down Expand Up @@ -185,35 +185,35 @@ def _get_order_by(self, query):
raise NotImplementedError


class FIFOBackend(SQLiteBackend):
component_name = 'SQLite FIFO Backend'
class FIFOBackend(SQLAlchemyBackend):
component_name = 'SQLAlchemy FIFO Backend'

def _get_order_by(self, query):
return query.order_by(self.page_model.created_at)


class LIFOBackend(SQLiteBackend):
component_name = 'SQLite LIFO Backend'
class LIFOBackend(SQLAlchemyBackend):
component_name = 'SQLAlchemy LIFO Backend'

def _get_order_by(self, query):
return query.order_by(self.page_model.created_at.desc())


class DFSBackend(SQLiteBackend):
component_name = 'SQLite DFS Backend'
class DFSBackend(SQLAlchemyBackend):
component_name = 'SQLAlchemy DFS Backend'

def _get_order_by(self, query):
return query.order_by(self.page_model.depth.desc(), self.page_model.created_at)


class BFSBackend(SQLiteBackend):
component_name = 'SQLite BFS Backend'
class BFSBackend(SQLAlchemyBackend):
component_name = 'SQLAlchemy BFS Backend'

def _get_order_by(self, query):
return query.order_by(self.page_model.depth, self.page_model.created_at)


BASE = SQLiteBackend
BASE = SQLAlchemyBackend
LIFO = LIFOBackend
FIFO = FIFOBackend
DFS = DFSBackend
Expand Down

0 comments on commit 8d1baea

Please sign in to comment.