Commit 4ae6bce6 authored by Vincent Pelletier's avatar Vincent Pelletier

Move client exception class definition to a separate python file, to simplify imports.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@253 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 805274c2
......@@ -22,19 +22,12 @@ from ZODB.utils import oid_repr, p64, u64
import logging
from neo.client.dispatcher import Dispatcher
from neo.client.app import Application
from neo.client.exception import NEOStorageConflictError, NEOStorageNotFoundError
from neo.event import EventManager
from neo.util import dump
from neo import connector as Connector
class NEOStorageError(POSException.StorageError):
pass
class NEOStorageConflictError(NEOStorageError):
pass
class NEOStorageNotFoundError(NEOStorageError):
pass
class Storage(BaseStorage.BaseStorage,
ConflictResolution.ConflictResolvingStorage):
"""Wrapper class for neoclient."""
......@@ -56,9 +49,7 @@ class Storage(BaseStorage.BaseStorage,
# Create dispatcher thread
dispatcher = Dispatcher(em, request_queue)
dispatcher.setDaemon(True)
# Import here to prevent recursive import
connector_handler = getattr(Connector, connector)
from neo.client.app import Application
self.app = Application(master_nodes, name, em, dispatcher,
request_queue, connector_handler)
# Connect to primary master node
......
......@@ -32,7 +32,7 @@ from neo.protocol import Packet, INVALID_UUID, INVALID_TID, INVALID_PARTITION, \
RUNNING_STATE, TEMPORARILY_DOWN_STATE, \
UP_TO_DATE_STATE, FEEDING_STATE, INVALID_SERIAL
from neo.client.handler import ClientEventHandler
from neo.client.Storage import NEOStorageError, NEOStorageConflictError, \
from neo.client.exception import NEOStorageError, NEOStorageConflictError, \
NEOStorageNotFoundError
from neo.util import makeChecksum, dump
......
#
# Copyright (C) 2006-2009 Nexedi SA
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from ZODB import POSException
class NEOStorageError(POSException.StorageError): pass
class NEOStorageConflictError(NEOStorageError): pass
class NEOStorageNotFoundError(NEOStorageError): pass
......@@ -25,7 +25,7 @@ from neo.protocol import Packet, \
BROKEN_STATE, PING
from neo.node import MasterNode, StorageNode, ClientNode
from neo.pt import PartitionTable
from neo.client.Storage import NEOStorageError
from neo.client.exception import NEOStorageError
from neo.exception import ElectionFailure
from neo.util import dump
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment