Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove remaining pycassa.connect() references

  • Loading branch information...
commit 4078bdbe2e35f3437cb193c8c15124634f6f63e1 1 parent 1c47f29
@thobbs thobbs authored
Showing with 13 additions and 8 deletions.
  1. +8 −5 doc/tutorial.rst
  2. +5 −3 pycassa/index.py
View
13 doc/tutorial.rst
@@ -102,15 +102,15 @@ running cassandra instance:
.. code-block:: python
- >>> import pycassa
- >>> pool = pycassa.connect('Keyspace1')
+ >>> from pycassa.pool import ConnectionPool
+ >>> pool = ConnectionPool('Keyspace1')
The above code will connect by default to ``localhost:9160``. We can
-also specify the host and port explicitly, as follows:
+also specify the host (or hosts) and port explicitly as follows:
.. code-block:: python
- >>> pool = pycassa.connect('Keyspace1', ['localhost:9160'])
+ >>> pool = ConnectionPool('Keyspace1', ['localhost:9160'])
This creates a small connection pool for use with a
:class:`~pycassa.columnfamily.ColumnFamily` . See `Connection Pooling`_
@@ -125,7 +125,10 @@ are included in the default schema file:
.. code-block:: python
- >>> pool = pycassa.connect('Keyspace1')
+ >>> from pycassa.pool import ConnectionPool
+ >>> from pycassa.columnfamily import ColumnFamily
+ >>>
+ >>> pool = ConnectionPool('Keyspace1')
>>> col_fam = pycassa.ColumnFamily(pool, 'ColumnFamily1')
If you get an error about the keyspace or column family not
View
8 pycassa/index.py
@@ -5,10 +5,12 @@
.. code-block:: python
- >>> import pycassa
+ >>> from pycassa.columnfamily import ColumnFamily
+ >>> from pycassa.pool import ConnectionPool
>>> from pycassa.index import *
- >>> pool = pycassa.connect('Keyspace1')
- >>> users = pycassa.ColumnFamily(pool, 'Users')
+ >>>
+ >>> pool = ConnectionPool('Keyspace1')
+ >>> users = ColumnFamily(pool, 'Users')
>>> state_expr = create_index_expression('state', 'Utah')
>>> bday_expr = create_index_expression('birthdate', 1970, GT)
>>> clause = create_index_clause([state_expr, bday_expr], count=20)
Please sign in to comment.
Something went wrong with that request. Please try again.