This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
acceso_a_bases_isis_desde_python [30/04/2009 16:22] fernando |
acceso_a_bases_isis_desde_python [26/01/2010 00:00] (current) |
||
---|---|---|---|
Line 64: | Line 64: | ||
===== wxis.py ===== | ===== wxis.py ===== | ||
- | Versión: 2008-03-28 | + | Versión: 2008-03-28 (plus some minor adjustments by user //newacct//, January 2010.) |
<code python> | <code python> | ||
Line 151: | Line 151: | ||
# books = IsisDb('/path/to/books') # check master existence, raise exception if it does not exist | # books = IsisDb('/path/to/books') # check master existence, raise exception if it does not exist | ||
# users = IsisDb('/path/to/users', create=True) # create unconditionally, don't check existence | # users = IsisDb('/path/to/users', create=True) # create unconditionally, don't check existence | ||
- | if 'create' in args.keys() and args['create'] == True: | + | if args.get('create'): |
self.__create() | self.__create() | ||
elif not self.__exists(): | elif not self.__exists(): | ||
Line 172: | Line 172: | ||
""" | """ | ||
resp = self.get_status() | resp = self.get_status() | ||
- | if resp['database']['status']['master'] == 'not found': | + | return resp['database']['status']['master'] != 'not found' |
- | return False | + | |
- | else: | + | |
- | return True | + | |
def __doTask(self, script, params, content=None): | def __doTask(self, script, params, content=None): | ||
Line 706: | Line 703: | ||
</code> | </code> | ||
- | {{tag>isis python}} | + | {{tag>desarrollo isis python}} |