Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed dependency on processing in favour of multiprocessing. Either…

… move to Py>=2.6, or use a backported multiprocessing.
  • Loading branch information...
commit 94cb4688a8d65e93bd6777f16a0e1439cadc4e32 1 parent 7487ba6
@alexsdutton alexsdutton authored
View
13 openorg_timeseries/longliving/database.py
@@ -9,7 +9,7 @@
import threading
import time
-import processing.managers
+import multiprocessing.managers
from django.conf import settings
from openorg_timeseries.database import TimeSeriesDatabase
@@ -62,8 +62,6 @@ def f(self, slug, *args, **kwargs):
return method(self, db, *args, **kwargs)
return f
-class DatabaseManager(processing.managers.BaseManager):
- get_client = processing.managers.CreatorMethod(typeid='get_client')
class DatabaseThread(threading.Thread):
def __init__(self, bail):
@@ -83,10 +81,8 @@ def run(self):
def get_client_func():
return _DatabaseClient(settings.TIME_SERIES_PATH, self.databases, self.main_lock, self.locks)
- class DatabaseManager(processing.managers.BaseManager):
- get_client = processing.managers.CreatorMethod(get_client_func, typeid='get_client')
-
- self.manager = DatabaseManager(**settings.TIME_SERIES_SERVER_ARGS)
+ self.manager = multiprocessing.managers.BaseManager(**settings.TIME_SERIES_SERVER_ARGS)
+ self.manager.register('get_client', get_client_func)
#self.bail_thread = threading.Thread(target=self.bail_watcher)
#self.bail_thread.start()
@@ -155,7 +151,8 @@ def fetch(self, db, aggregation_type, interval, period_start, period_end):
return list(db.fetch(aggregation_type, interval, period_start, period_end))
def get_client():
- manager = DatabaseManager.from_address(**settings.TIME_SERIES_SERVER_ARGS)
+ manager = multiprocessing.managers.BaseManager(**settings.TIME_SERIES_SERVER_ARGS)
+ manager.connect()
return manager.get_client()
def run():
View
10 openorg_timeseries/test_settings.py
@@ -1,10 +0,0 @@
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'TEST_NAME': 'test_db.sqlite',
- },
-}
-
-INSTALLED_APPS = [
- 'openorg_timeseries',
-]
View
1  requirements.txt
@@ -3,5 +3,4 @@ django-conneg
python-dateutil==1.5
pytz
rdflib>=3.0
-processing
django-object-permissions
Please sign in to comment.
Something went wrong with that request. Please try again.