Permalink
Browse files

Fixing the httplib2 import error during installing

  • Loading branch information...
1 parent ac652c9 commit 04f2dfbeb4a02bc81b30b9d6ae513cbf48ed4cfb @versae committed Jun 22, 2011
Showing with 27 additions and 20 deletions.
  1. +1 −1 README.rst
  2. +15 −8 README.txt
  3. +0 −3 neo4jrestclient/__init__.py
  4. +9 −6 neo4jrestclient/client.py
  5. +2 −2 neo4jrestclient/tests.py
View
2 README.rst
@@ -27,7 +27,7 @@ Getting started
The main class is *GraphDatabase*, exactly how in neo4j.py_::
- >>> from neo4jrestclient import GraphDatabase
+ >>> from neo4jrestclient.client import GraphDatabase
>>> gdb = GraphDatabase("http://localhost:7474/db/data/")
View
23 README.txt
@@ -27,21 +27,28 @@ Getting started
The main class is *GraphDatabase*, exactly how in neo4j.py_::
- >>> from neo4jrestclient import GraphDatabase
+ >>> from neo4jrestclient.client import GraphDatabase
>>> gdb = GraphDatabase("http://localhost:7474/db/data/")
-Two global options are available::
-
- neo4jrestclient.request.CACHE = False # Default
+Options
+-------
+There some global options available::
If CACHE is 'True', a '.cache' directory is created and the future request to
-the same URL will be taken from cache
-And::
+the same URL will be taken from cache::
+
+ neo4jrestclient.options.CACHE = False # Default
+
+If DEBUG is 'True', 'httplib2' is set to debuglevel = 1::
+
+ neo4jrestclient.options.DEBUG = False # Default
- neo4jrestclient.request.DEBUG = False # Default
+And SMART_ERRORS, set to 'False' by default. In case of 'True', the standard
+HTTP errors will be replaced by more pythonic errors (i.e. 'KeyError' instead
+of 'NotFoundError' in some cases)::
-If DEBUG is 'True', 'httplib2' is set to debuglevel = 1.
+ neo4jrestclient.options.SMART_ERRORS = False # Default
Node, Relationships and Properties
View
3 neo4jrestclient/__init__.py
@@ -1,3 +0,0 @@
-from client import (GraphDatabase, Incoming, Outgoing, Undirected,
- StopAtDepth, NotFoundError, StatusException)
-from constants import (INDEX_EXACT, INDEX_FULLTEXT)
View
15 neo4jrestclient/client.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import json
import urllib
-import re
import options
from constants import (BREADTH_FIRST, DEPTH_FIRST,
@@ -13,6 +12,9 @@
INDEX_FULLTEXT)
from request import Request, NotFoundError, StatusException
+__all__ = ["GraphDatabase", "Incoming", "Outgoing", "Undirected",
+ "StopAtDepth", "NotFoundError", "StatusException"]
+
class StopAtDepth(object):
"""
@@ -366,14 +368,14 @@ def traverse(self, types=None, order=None, stop=None, returnable=None,
if isinstance(stop, (int, float)):
data.update({"max depth": stop})
elif stop is STOP_AT_END_OF_GRAPH:
- data.update({'prune evaluator':{
- 'language':'javascript',
- 'body':'false',
+ data.update({'prune evaluator': {
+ 'language': 'javascript',
+ 'body': 'false',
}})
if returnable in (BREADTH_FIRST, DEPTH_FIRST):
data.update({"return filter": {
- "language": "builtin",
- "name": returnable,
+ "language": "builtin",
+ "name": returnable,
}})
if uniqueness in (NODE_GLOBAL, NODE_PATH, NODE_RECENT, NODE,
RELATIONSHIP_GLOBAL, RELATIONSHIP_PATH,
@@ -657,6 +659,7 @@ def query(self, *args):
key, query = args
return self.get(key).query(query)
+
class RelationshipsProxy(dict):
"""
Class proxy for relationships in order to allow get a relationship by id
View
4 neo4jrestclient/tests.py
@@ -1,4 +1,5 @@
-import client, constants
+import client
+import constants
import request
import unittest
@@ -207,7 +208,6 @@ def test_query_index(self):
self.assertTrue(n1 in results and n2 in results)
results = index.query("surnames:do*")
self.assertTrue(n1 in results and n2 in results)
-
class TraversalsTestCase(IndexesTestCase):

0 comments on commit 04f2dfb

Please sign in to comment.