commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue common/etc/sample.report-filters.conf comm...


From: Jason Cater
Subject: gnue common/etc/sample.report-filters.conf comm...
Date: Sat, 06 Apr 2002 20:20:36 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/04/06 20:20:36

Modified files:
        common/etc     : sample.report-filters.conf 
        common/src     : GConfig.py 
        reports/src    : GRLayout.py GRRun.py 
Added files:
        reports/adapters: __init__.py 
        reports/adapters/email: __init__.py smtp.py 
        reports/adapters/fax: __init__.py hylafax.py 
        reports/adapters/file: __init__.py text.py 
        reports/adapters/printer: __init__.py bsd.py 
        reports/src    : GRFilters.py 

Log message:
        lots o' work on reports

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/etc/sample.report-filters.conf.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/GConfig.py.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/__init__.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/email/__init__.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/email/smtp.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/fax/__init__.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/fax/hylafax.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/file/__init__.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/file/text.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/printer/__init__.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/adapters/printer/bsd.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRFilters.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRLayout.py.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRRun.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: gnue/common/etc/sample.report-filters.conf
diff -c gnue/common/etc/sample.report-filters.conf:1.1 
gnue/common/etc/sample.report-filters.conf:1.2
*** gnue/common/etc/sample.report-filters.conf:1.1      Sat Apr  6 17:27:14 2002
--- gnue/common/etc/sample.report-filters.conf  Sat Apr  6 20:20:35 2002
***************
*** 3,24 ****
  testing = GNUe:Reports:UnsupportedSimple
  
  
! [simple:text]
  description = Basic text without any formatting
  
  
! [simple:html]
  description = HTML 3.0-compatable markup.
  
  
  #[standard:pdf]
  #description = Portable Document Format
  #
  #[standard:ps]
  #description = Postscript
! 
! 
! # DO NOT REMOVE THIS SECTION
! [standard:raw]
! description = Perform no output processing.  Emit raw GNUe Reports XML.
! 
--- 3,28 ----
  testing = GNUe:Reports:UnsupportedSimple
  
  
! [testing:text]
  description = Basic text without any formatting
+ engine = sablotron
  
  
! [testing:html]
  description = HTML 3.0-compatable markup.
+ engine = sablotron
  
  
+ #
+ #[standard:text]
+ #description = Portable Document Format
+ #
+ #[standard:html]
+ #description = Portable Document Format
+ #
  #[standard:pdf]
  #description = Portable Document Format
  #
  #[standard:ps]
  #description = Postscript
! #
\ No newline at end of file
Index: gnue/common/src/GConfig.py
diff -c gnue/common/src/GConfig.py:1.11 gnue/common/src/GConfig.py:1.12
*** gnue/common/src/GConfig.py:1.11     Sat Apr  6 16:17:02 2002
--- gnue/common/src/GConfig.py  Sat Apr  6 20:20:35 2002
***************
*** 123,128 ****
--- 123,132 ----
  
      try:
        self._parser.readfp(fileHandle)
+       try:
+         fileHandle.close()
+       except AttributeError:
+         pass
      except DuplicateSectionError:
        raise InvalidFormatError, 'The file has duplicate source definitions.'
      except MissingSectionHeaderError:
Index: gnue/reports/src/GRLayout.py
diff -c gnue/reports/src/GRLayout.py:1.17 gnue/reports/src/GRLayout.py:1.18
*** gnue/reports/src/GRLayout.py:1.17   Sat Apr  6 02:27:27 2002
--- gnue/reports/src/GRLayout.py        Sat Apr  6 20:20:36 2002
***************
*** 175,181 ****
  
    #
    # Process layout and dump output.
!   # self.prepare *must* be called prior to processing    .
    #
    def process(self, dest, includeStructuralComments=0):
  
--- 175,181 ----
  
    #
    # Process layout and dump output.
!   # self.prepare *must* be called prior to processing
    #
    def process(self, dest, includeStructuralComments=0):
  
***************
*** 267,272 ****
--- 267,274 ----
  
      return ContainerElement._buildObject(self)
  
+ 
+   #
    # Retrieve the first row of data, if available.
    # Handle default data if no rows retrieved.
    #
Index: gnue/reports/src/GRRun.py
diff -c gnue/reports/src/GRRun.py:1.6 gnue/reports/src/GRRun.py:1.7
*** gnue/reports/src/GRRun.py:1.6       Sat Apr  6 01:45:11 2002
--- gnue/reports/src/GRRun.py   Sat Apr  6 20:20:36 2002
***************
*** 1,19 ****
  #
  # This file is part of GNU Enterprise.
  #
! # GNU Enterprise is free software; you can redistribute it 
! # and/or modify it under the terms of the GNU General Public 
! # License as published by the Free Software Foundation; either 
  # version 2, or (at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be 
! # useful, but WITHOUT ANY WARRANTY; without even the implied 
! # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  # PURPOSE. See the GNU General Public License for more details.
  #
! # You should have received a copy of the GNU General Public 
! # License along with program; see the file COPYING. If not, 
! # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
  # Copyright 2000-2002 Free Software Foundation
--- 1,19 ----
  #
  # This file is part of GNU Enterprise.
  #
! # GNU Enterprise is free software; you can redistribute it
! # and/or modify it under the terms of the GNU General Public
! # License as published by the Free Software Foundation; either
  # version 2, or (at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be
! # useful, but WITHOUT ANY WARRANTY; without even the implied
! # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  # PURPOSE. See the GNU General Public License for more details.
  #
! # You should have received a copy of the GNU General Public
! # License along with program; see the file COPYING. If not,
! # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
  # Copyright 2000-2002 Free Software Foundation
***************
*** 28,38 ****
  #
  
  
! from gnue.common import GDebug
  from gnue.common.GClientApp import GClientApp
  from GREngine import GREngine
  import GRExceptions
  import string, sys
  
  
  
--- 28,40 ----
  #
  
  
! from gnue.reports import VERSION
! from gnue.common import GDebug, GConfig
  from gnue.common.GClientApp import GClientApp
  from GREngine import GREngine
  import GRExceptions
  import string, sys
+ import tempfile
  
  
  
***************
*** 54,110 ****
    VERSION = "0.0.1"
    COMMAND = "grrun"
    NAME = "GNUe Reports Client"
!   COMMAND_OPTIONS = [ 
!       [ 'destination_type', 'D', 'destination-type', 1, 'file', 'type',  
            'This specifies how the report should be output. The currently '
            'supported values for <type> are file [default], printer, email, '
            'and fax. Note that printer, email, and fax are sent via the '
            'server\'s machine, not the client\'s machine.  To '
!           '\n[NOT YET IMPLEMENTED]' ],
!       [ 'destination', 'p', 'destination', 1, 'lp', 'dest', 
!           'Where should the report be output to?  The value of this ' 
            'depends on the destination type (e.g., if sending to printer, '
            'then -p specifies the printer name; if sending via email, then '
            '-p specifies the email address.) If <dest> is "-", then output is '
            'sent to stdout -- NOTE: when sending to stdout, also use the -q '
            '[--quiet] option or you may get junk in your output stream. '
!           '\n[NOT YET IMPLEMENTED]'],
        [ 'filter', 'f', 'filter', 1, 'raw', 'filt',
            'Select the filter to be used to process report output.  <filt> '
            'is the name of the filtering process as defined on the Report '
            'Server machine. If not specified, the "raw" filter is used '
!           '(i.e., no filtering takes place.)'], 
!       [ 'list_filters', None, 'filter-list', 0, 0, None,  
!           'List the available [predefined] filters available to GNUe 
Reports'], 
!       [ 'filter_options', 'O', 'filter-options', 1, '', 'opts',  
            'Options to pass to the filter process. Available options are '
            'specific to the filter.  --filter-list will list available filters 
'
!           'and their options.  Example: \'--filter-options "paper=letter 
margin=1,1,1,1" \''], 
!       [ 'sortoption', 's', 'sort-option', 1, '', 'sort',  
!           'Select the "sort-option" used to sort the report. '], 
!       [ 'quiet', 'q', 'quiet', 0, 0, None,  
            'Run GNUe Reports in quiet mode -- i.e., display no output. '
            'NOTE: if --debug-level is specified, then suppressed text will '
!           'be output as debugging information (at debug level 1)'], 
!       [ 'comment', 'C', 'comment', 0, 0, None,  
            'Include structural comments in the XML output stream. '
!           'Useful for debugging .grd files.'], 
!       [ 'standalone', 'S', 'standalone', 0, 0, None,  
            'Create a standalone, single-use server instance.  Use this option 
in a '
!           'non-client/server environment or in a debugging/development 
environment.'], 
!       [ 'exclude_xml', 'X', 'exclude-xml', 0, 0, None,  
            'Do not output GNUe Report''s runtime XML markup information.  If 
specified, '
            'then the GRD''s layout section will be processed and output '
            'as-is; i.e., without any additional information added by '
!           'GNUe Reports.'], 
!       [ 'user', 'u', 'user', 1, '', 'name',  
            'Username used to log into the database.  Note that if '
            'specified, this will be used for all databases.  If not '
!           'supplied, the program will prompt for username.'], 
!       [ 'password', None, 'pass', 1, '', 'passwd', 
            'Password used to log into the database.  Note that if '
            'specified, this will be used for all databases.  If not '
!           'supplied, the program will prompt for password.\nNOTE THAT '
            'SUPPLYING A PASSWORD VIA THE COMMAND LINE MAY BE CONSIDERED '
            'A SECURITY RISK.' ] ]
    SUMMARY = \
--- 56,114 ----
    VERSION = "0.0.1"
    COMMAND = "grrun"
    NAME = "GNUe Reports Client"
!   COMMAND_OPTIONS = [
!       [ 'destination_type', 'D', 'destination-type', 1, 'file', 'type',
            'This specifies how the report should be output. The currently '
            'supported values for <type> are file [default], printer, email, '
            'and fax. Note that printer, email, and fax are sent via the '
            'server\'s machine, not the client\'s machine.  To '
!           '\nNOTE: Only file, printer, and email are currently implemented!' 
],
!       [ 'destination', 'p', 'destination', 1, '-', 'dest',
!           'Where should the report be output to?  The value of this '
            'depends on the destination type (e.g., if sending to printer, '
            'then -p specifies the printer name; if sending via email, then '
            '-p specifies the email address.) If <dest> is "-", then output is '
            'sent to stdout -- NOTE: when sending to stdout, also use the -q '
            '[--quiet] option or you may get junk in your output stream. '
!           'NOTE: Currently the default value is "-" -- this may change once 
GNUe '
!           'Reports is formally released!'],
        [ 'filter', 'f', 'filter', 1, 'raw', 'filt',
            'Select the filter to be used to process report output.  <filt> '
            'is the name of the filtering process as defined on the Report '
            'Server machine. If not specified, the "raw" filter is used '
!           '(i.e., no filtering takes place.)'],
!       [ 'list_filters', None, 'filter-list', 0, 0, None,
!           'List the available [predefined] filters available to GNUe 
Reports'],
!       [ 'filter_options', 'O', 'filter-options', 1, '', 'opts',
            'Options to pass to the filter process. Available options are '
            'specific to the filter.  --filter-list will list available filters 
'
!           'and their options.  Example: \'--filter-options "paper=letter 
margin=1,1,1,1" \''],
!       [ 'sortoption', 's', 'sort-option', 1, '', 'sort',
!           'Select the "sort-option" used to sort the report. '],
!       [ 'quiet', 'q', 'quiet', 0, 0, None,
            'Run GNUe Reports in quiet mode -- i.e., display no output. '
            'NOTE: if --debug-level is specified, then suppressed text will '
!           'be output as debugging information (at debug level 1)'],
!       [ 'comment', 'C', 'comment', 0, 0, None,
            'Include structural comments in the XML output stream. '
!           'Useful for debugging .grd files.'],
!       [ 'standalone', 'S', 'standalone', 0, 0, None,
            'Create a standalone, single-use server instance.  Use this option 
in a '
!           'non-client/server environment or in a debugging/development 
environment. '
!           'NOTE: Until the Reports Server is operational, this mode is 
implied'],
!       [ 'exclude_xml', 'X', 'exclude-xml', 0, 0, None,
            'Do not output GNUe Report''s runtime XML markup information.  If 
specified, '
            'then the GRD''s layout section will be processed and output '
            'as-is; i.e., without any additional information added by '
!           'GNUe Reports.'],
!       [ 'user', 'u', 'user', 1, '', 'name',
            'Username used to log into the database.  Note that if '
            'specified, this will be used for all databases.  If not '
!           'supplied, the program will prompt for username.'],
!       [ 'password', None, 'pass', 1, '', 'passwd',
            'Password used to log into the database.  Note that if '
            'specified, this will be used for all databases.  If not '
!           'supplied, the program will prompt for password.\nNOTE: '
            'SUPPLYING A PASSWORD VIA THE COMMAND LINE MAY BE CONSIDERED '
            'A SECURITY RISK.' ] ]
    SUMMARY = \
***************
*** 129,142 ****
      self.getConnectionManager().setLoginHandler(lh)
  
  
!   def run(self): 
  
      #
      # Are we doing a simple help-like operation?
      #
!     
      # ...list available filters?
!     if self.OPTIONS["list_filters"]: 
        self.listFilters()
        sys.exit()
  
--- 133,146 ----
      self.getConnectionManager().setLoginHandler(lh)
  
  
!   def run(self):
  
      #
      # Are we doing a simple help-like operation?
      #
! 
      # ...list available filters?
!     if self.OPTIONS["list_filters"]:
        self.listFilters()
        sys.exit()
  
***************
*** 183,205 ****
        quietprint = _quietprintSuppress
        quietprint_nl = _quietprintSuppress
  
-     
  
!     try: 
!       GREngine(self.getConnectionManager()).processReport(reportfile, \
!           parameters=userParameters, sortoption=sortoption, \
!           includeStructuralComments=self.OPTIONS["comment"], 
            omitGNUeXML=self.OPTIONS["exclude_xml"])
!     except GRExceptions.ReportMarkupException, msg: 
        self.handleStartupError (msg)
!     except GRExceptions.ReportUnreadable, msg: 
        self.handleStartupError (msg)
  
  
    #
    # List filters available on the server
    #
!   def listFilters(self): 
  
      # TODO: um, implement??
  
--- 187,259 ----
        quietprint = _quietprintSuppress
        quietprint_nl = _quietprintSuppress
  
  
!     #
!     # Where are we destined for?
!     #
! 
!     tempname = None
!     filter = self.OPTIONS["filter"]
!     desname = self.OPTIONS["destination"]
!     destype = string.lower(self.OPTIONS["destination_type"])
! 
!     if destype not in ('printer','email','fax','file'):
!       self.handleStartupError ("Destination type must be one of " \
!              + "'printer','email','fax', or 'file'.")
! 
!     if destype == 'file' and desname == '-':
!       outputHandle = sys.stdout
!       sys.stdout = sys.stderr
! 
!     #
!     # TODO: replace with handlers
!       #
!     elif destype == 'file' and filter == 'raw':
!       try:
!         outputHandle = open(desname, 'w')
!       except IOError:
!         self.handleStartupError ("Unable to open '%s' for output." % desname)
!     else:
!       tmpdir = GConfig.get('TempDir','')
!       if tmpdir:
!         tempfile.tmpdir = tmpdir
!       tmpname = tempfile.mktemp('-grrun.raw')
!       GDebug.printMesg(2,'Using temporary file %s for raw output' % tmpname)
!       try:
!         outputHandle = open(tmpname, 'w')
!       except IOError:
!         self.handleStartupError ("Unable to open '%s' for output." % tmpname)
! 
! 
!     #
!     # Now, run an engine instance
!     #
!     # TODO: Once reports is server-ized, this call
!     # TODO: will happen only if --standalone is
!     # TODO: specified. Otherwise, a call to gnu-rpc
!     # TODO: will cause this equivalent code to be
!     # TODO: run on the server instance.
!     #
!     try:
!       GREngine(self.getConnectionManager()).processReport(reportfile,
!           outputHandle = outputHandle,
!           parameters=userParameters, sortoption=sortoption,
!           includeStructuralComments=self.OPTIONS["comment"],
            omitGNUeXML=self.OPTIONS["exclude_xml"])
!     except GRExceptions.ReportMarkupException, msg:
        self.handleStartupError (msg)
!     except GRExceptions.ReportUnreadable, msg:
        self.handleStartupError (msg)
  
+     # Cleanup
+     outputHandle.close()
+     if tempname:
+       os.remove(tempname)
  
    #
    # List filters available on the server
    #
!   def listFilters(self):
  
      # TODO: um, implement??
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]