changeset 313:22fc9a350eaa

finally, ls working right
author catherine@Elli.myhome.westell.com
date Mon, 30 Mar 2009 13:15:36 -0400
parents c6abd01fe3e1
children 0473ad96ddb7
files docs/source/conf.py docs/source/intro.rst setup.py sqlpython/mysqlpy.py sqlpython/sqlpyPlus.py sqlpython/sqlpython.py
diffstat 6 files changed, 246 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/source/conf.py	Mon Mar 30 13:15:36 2009 -0400
@@ -0,0 +1,194 @@
+# -*- coding: utf-8 -*-
+#
+# sqlpython documentation build configuration file, created by
+# sphinx-quickstart on Sat Mar 28 11:49:41 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'sqlpython'
+copyright = u'2009, Catherine Devlin'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '1.6'
+# The full version, including alpha/beta/rc tags.
+release = '1.6.2'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'sqlpythondoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'sqlpython.tex', u'sqlpython Documentation',
+   u'Catherine Devlin', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
--- a/docs/source/intro.rst	Sat Mar 28 11:42:38 2009 -0400
+++ b/docs/source/intro.rst	Mon Mar 30 13:15:36 2009 -0400
@@ -13,6 +13,10 @@
 SQLPython was created by `Luca Canali <http://canali.web.cern.ch/canali/>`_ at CERN.  Most new development
 has been done by `Catherine Devlin <http://catherinedevlin.blogspot.com/>`_.  The development trunk (very unstable) is at `assembla <https://www.assembla.com/wiki/show/sqlpython>`_; you can install the trunk on your machine with::
 
+  hg clone http://hg.assembla.com/python-cmd2 cmd2
+	cd cmd2
+	python setup.py develop
+
 	hg clone http://hg.assembla.com/sqlpython sqlpython
 	cd sqlpython
 	python setup.py develop
--- a/setup.py	Sat Mar 28 11:42:38 2009 -0400
+++ b/setup.py	Mon Mar 30 13:15:36 2009 -0400
@@ -9,7 +9,7 @@
 Operating System :: OS Independent""".splitlines()
 
 setup(name="sqlpython",
-      version="1.6.2",
+      version="1.6.3",
       description="Command-line interface to Oracle",
       long_description="Customizable alternative to Oracle's SQL*PLUS command-line interface",
       author="Luca Canali",
--- a/sqlpython/mysqlpy.py	Sat Mar 28 11:42:38 2009 -0400
+++ b/sqlpython/mysqlpy.py	Mon Mar 30 13:15:36 2009 -0400
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# MySqlPy V1.6.2
+# MySqlPy V1.6.3
 # Author: Luca.Canali@cern.ch
 # 
 #
@@ -13,9 +13,9 @@
 
 class mysqlpy(sqlpyPlus):
     '''
-MySqlPy V1.6.2 - 'sqlplus in python'
+MySqlPy V1.6.3 - 'sqlplus in python'
 Author: Luca.Canali@cern.ch
-Rev: 1.6.2, 24-Mar-09
+Rev: 1.6.3, 30-Mar-09
 
 Companion of SqlPython, a python module that reproduces Oracle's command line within python
 and sqlpyPlus. Major contributions by Catherine Devlin, http://catherinedevlin.blogspot.com
--- a/sqlpython/sqlpyPlus.py	Sat Mar 28 11:42:38 2009 -0400
+++ b/sqlpython/sqlpyPlus.py	Mon Mar 30 13:15:36 2009 -0400
@@ -1380,6 +1380,8 @@
     def _ls_statement(self, arg, opts):
         if arg:
             target = arg.upper().replace('*','%')
+            if target in self.object_types:
+                target += '/%'
             where = """\nWHERE object_type || '/' || object_name LIKE '%s'
                        OR object_name LIKE '%s'""" % (target, target)
         else:
@@ -1415,11 +1417,49 @@
                   ORDER BY object_type, object_name''' % clauses
         self._execute(statement)
         return self.curs.fetchall()
+
+    object_types = (
+        'CLUSTER',              
+        'CONSUMER GROUP',       
+        'CONTEXT',              
+        'DIRECTORY',            
+        'EDITION',              
+        'EVALUATION CONTEXT',   
+        'FUNCTION',             
+        'INDEX',                
+        'INDEX PARTITION',      
+        'INDEXTYPE',            
+        'JAVA CLASS',           
+        'JAVA DATA',            
+        'JAVA RESOURCE',        
+        'JOB',                  
+        'JOB CLASS',            
+        'LIBRARY',              
+        'MATERIALIZED VIEW',    
+        'OPERATOR',             
+        'PACKAGE',              
+        'PACKAGE BODY',         
+        'PROCEDURE',            
+        'PROGRAM',              
+        'RULE',                 
+        'RULE SET',             
+        'SCHEDULE',             
+        'SEQUENCE',             
+        'SYNONYM',              
+        'TABLE',                
+        'TABLE PARTITION',      
+        'TRIGGER',              
+        'TYPE',                 
+        'TYPE BODY',            
+        'VIEW',                 
+        'WINDOW',               
+        'WINDOW GROUP',         
+        'XML SCHEMA')
     
     @options([make_option('-l', '--long', action='store_true', help='long descriptions'),
               make_option('-a', '--all', action='store_true', help="all schemas' objects"),
               make_option('-t', '--timesort', action='store_true', help="Sort by last_ddl_time"),              
-              make_option('-r', '--reverse', action='store_true', help="Reverse order while sorting")])        
+              make_option('-r', '--reverse', action='store_true', help="Reverse order while sorting")])            
     def do_ls(self, arg, opts):
         '''
         Lists objects as through they were in an {object_type}/{object_name} UNIX
--- a/sqlpython/sqlpython.py	Sat Mar 28 11:42:38 2009 -0400
+++ b/sqlpython/sqlpython.py	Mon Mar 30 13:15:36 2009 -0400
@@ -1,7 +1,7 @@
 #
-# SqlPython V1.6.2
+# SqlPython V1.6.3
 # Author: Luca.Canali@cern.ch, Apr 2006
-# Rev 25-Feb-09
+# Rev 30-Mar-09
 #
 # A python module to reproduce Oracle's command line 'sqlplus-like' within python
 # Intended to allow easy customizations and extentions 
@@ -10,7 +10,7 @@
 
 import cmd2,getpass,binascii,cx_Oracle,re,os
 import sqlpyPlus
-__version__ = '1.6.2'    
+__version__ = '1.6.3'    
 
 class sqlpython(cmd2.Cmd):
     '''A python module to reproduce Oracle's command line with focus on customization and extention'''