[Scipy-svn] r2714 - trunk/Lib/sandbox/timeseries/io/fame
scipy-svn at scipy.org
scipy-svn at scipy.org
Thu Feb 15 13:35:37 EST 2007
Author: mattknox_ca
Date: 2007-02-15 12:35:34 -0600 (Thu, 15 Feb 2007)
New Revision: 2714
Modified:
trunk/Lib/sandbox/timeseries/io/fame/fame.py
Log:
add set_option function
Modified: trunk/Lib/sandbox/timeseries/io/fame/fame.py
===================================================================
--- trunk/Lib/sandbox/timeseries/io/fame/fame.py 2007-02-15 18:35:05 UTC (rev 2713)
+++ trunk/Lib/sandbox/timeseries/io/fame/fame.py 2007-02-15 18:35:34 UTC (rev 2714)
@@ -25,12 +25,11 @@
class DBError(Exception): pass
-
class FameDb(object):
"""Fame database object
:Construction:
- x = FameDb(conn_str, mode='r', large=True)
+ x = FameDb(conn_str, mode='r')
:Paramaters:
- `conn_str` (str) : valid connection string. Can be a physical path,
@@ -43,12 +42,8 @@
'c' => create
'u' => update
'w' => write
- 'd' => direct
- - `large` (boolean, *[True]*) : Applies only when `mode` is 'o' or 'c'.
- If True, a large size database will be created. If False, a standard size
- database will be created.
-"""
- def __init__(self, conn_str, mode='r', large=True):
+ 'd' => direct"""
+ def __init__(self, conn_str, mode='r'):
mode = mode.lower()
if mode == 'r':
intmode = mp.HRMODE
@@ -69,7 +64,7 @@
self.mode = mode
try:
- self.dbkey = cf_open(conn_str, intmode, int(large))
+ self.dbkey = cf_open(conn_str, intmode)
self.dbIsOpen = True
except:
self.dbIsOpen = False
@@ -643,6 +638,7 @@
return result
cf_open = cFameCall(cfame.open)
+cf_set_option = cFameCall(cfame.set_option)
cf_close = cFameCall(cfame.close)
cf_restore = cFameCall(cfame.restore)
cf_size = cFameCall(cfame.size)
@@ -654,4 +650,17 @@
cf_write_series = cFameCall(cfame.write_series)
cf_write_namelist = cFameCall(cfame.write_namelist)
cf_wildlist = cFameCall(cfame.wildlist)
-cf_exists = cFameCall(cfame.exists)
\ No newline at end of file
+cf_exists = cFameCall(cfame.exists)
+
+set_option = cf_set_option
+set_option.__doc__ = \
+"""Set an option in the C HLI. See the FAME documentation for cfmsopt for a
+listing of allowable option settings.
+
+:Parameters:
+ - option (str) : name of the option to set
+ - setting (str) : value of the option to set
+
+:Example:
+ set_option("DBSIZE", "LARGE")
+"""
More information about the Scipy-svn
mailing list