commit-gnue
[Top][All Lists]
Advanced

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

gnue common/etc/sample.gnue.conf reports/src/GR...


From: Jason Cater
Subject: gnue common/etc/sample.gnue.conf reports/src/GR...
Date: Fri, 12 Apr 2002 18:21:34 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/04/12 18:21:34

Modified files:
        common/etc     : sample.gnue.conf 
        reports/src    : GRFilters.py GRReport.py 

Log message:
        synching machines

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/etc/sample.gnue.conf.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/src/GRFilters.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/src/GRReport.py.diff?tr1=1.20&tr2=1.21&r1=text&r2=text

Patches:
Index: gnue/common/etc/sample.gnue.conf
diff -c gnue/common/etc/sample.gnue.conf:1.25 
gnue/common/etc/sample.gnue.conf:1.26
*** gnue/common/etc/sample.gnue.conf:1.25       Fri Apr 12 01:59:32 2002
--- gnue/common/etc/sample.gnue.conf    Fri Apr 12 18:21:34 2002
***************
*** 98,104 ****
  msg_previous_block=Navigate to previous data block.
  msg_query_prep=Switch to input query mask mode.
  msg_query=Execute query using current mask.
! msg_help=Display info about GNUe Forms. 
  msg_jump=Prompts for a record number to which the system should jump.
  msg_print=Perform print routine for this form
  
--- 98,104 ----
  msg_previous_block=Navigate to previous data block.
  msg_query_prep=Switch to input query mask mode.
  msg_query=Execute query using current mask.
! msg_help=Display info about GNUe Forms.
  msg_jump=Prompts for a record number to which the system should jump.
  msg_print=Perform print routine for this form
  
***************
*** 209,214 ****
--- 209,215 ----
  
  [reports]
  ReportsDir = reports
+ FiltersDir = filters
  
  # TempDir = /usr/tmp
  
***************
*** 227,233 ****
  FaxAdapter = hylafax
  
  # DestinationType options
! # (%s will be replaced with the printer name) 
  LprCommand = /usr/bin/lpr -P%s
  
  # Sendmail binary (for EmailAdapter=sendmail)
--- 228,234 ----
  FaxAdapter = hylafax
  
  # DestinationType options
! # (%s will be replaced with the printer name)
  LprCommand = /usr/bin/lpr -P%s
  
  # Sendmail binary (for EmailAdapter=sendmail)
***************
*** 235,241 ****
  SendmailFrom = address@hidden
  SendmailSubject = Your Requested Report
  
! # HylaFax sendfax binary (for FaxAdapter = hylafax) 
  HylaFaxBin = /usr/bin/sendfax
  
  
--- 236,242 ----
  SendmailFrom = address@hidden
  SendmailSubject = Your Requested Report
  
! # HylaFax sendfax binary (for FaxAdapter = hylafax)
  HylaFaxBin = /usr/bin/sendfax
  
  
Index: gnue/reports/src/GRFilters.py
diff -c gnue/reports/src/GRFilters.py:1.3 gnue/reports/src/GRFilters.py:1.4
*** gnue/reports/src/GRFilters.py:1.3   Fri Apr 12 01:59:34 2002
--- gnue/reports/src/GRFilters.py       Fri Apr 12 18:21:34 2002
***************
*** 62,74 ****
  class GRFilterConfig:
  
    def __init__(self):
      self.mappings = {}
      location = GConfig.get('filters','')
      if location:
        if location[0] != '/':
!         if os.environ.has_key('INSTALL_PREFIX'):
!           location = os.environ['INSTALL_PREFIX']+'/' + location
! 
        self.readConfig(location)
  
  
--- 62,83 ----
  class GRFilterConfig:
  
    def __init__(self):
+ 
      self.mappings = {}
+     self.filters = {}
+ 
+     # Get the install prefix
+     if os.environ.has_key('INSTALL_PREFIX'):
+       install_prefix = os.environ['INSTALL_PREFIX']
+     else:
+       install_prefix = '/usr/local/gnue'
+ 
+ 
+     # Load the report-filters file
      location = GConfig.get('filters','')
      if location:
        if location[0] != '/':
!         location = install_prefix + location
        self.readConfig(location)
  
  
***************
*** 97,106 ****
        raise InvalidFormatError, 'The file cannot be parsed.'
  
  
      for option in self._parser.options('mappings'):
        self.mappings[string.lower(option)] = 
self._parser.get('mappings',option)
  
  
  
    def getFilters(self):
!     return []
\ No newline at end of file
--- 106,146 ----
        raise InvalidFormatError, 'The file cannot be parsed.'
  
  
+     # Pre-load the mappings section, as it's
+     # needed for interpreting the other sections.
      for option in self._parser.options('mappings'):
        self.mappings[string.lower(option)] = 
self._parser.get('mappings',option)
  
+     # Get the base directory for filters
+     filterBase = GConfig.get('FiltersDir','filters')
+     if filterBase[0] != '/':
+       filterBase = install_prefix + '/' + filterBase
+ 
+     # Pull in all the other sections
+     for section in self._parser.sections():
+       if section != 'mappings':
+ 
+         # First, translate any mappings
+         transparts = string.split(section,':')
+         translookup = string.join(transparts[:-1],':')
+         if len(transparts) > 1 and \
+            self.mappings.has_key(transparts[0]):
+           translated = "%s:%s" % (self.mappings[translookup], transparts[-1])
+         else:
+           translated = section
+         self.filters[translated] = {}
+ 
+         # Then pull in the config variables
+         for option in self._parser.options(section):
+           if option == 'script' and script[0] != '/':
+ 
+           self.filters[translated][option] = self._parser.get(section, option)
+ 
+     print self.filters
+ 
  
+   def getMappings(self):
+     return tuple(self.mappings)
  
    def getFilters(self):
!     return []
Index: gnue/reports/src/GRReport.py
diff -c gnue/reports/src/GRReport.py:1.20 gnue/reports/src/GRReport.py:1.21
*** gnue/reports/src/GRReport.py:1.20   Fri Apr 12 16:56:53 2002
--- gnue/reports/src/GRReport.py        Fri Apr 12 18:21:34 2002
***************
*** 112,120 ****
        else:
          ns = ""
  
        dest.write ('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
!       #dest.write ('<!DOCTYPE ... >\n')
        dest.write ('<gnue:report-output xmlns:gnue="GNUe:Reports:Base"%s>\n' % 
ns)
        dest.write ("  <gnue:report-request>\n")
        dest.write ( parameters.getRunOptionsAsXML() )
        dest.write ( sortoptions.getRunOptionsAsXML() )
--- 112,123 ----
        else:
          ns = ""
  
+       # TODO: other encodings???
        dest.write ('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
! 
!       #TODO: (?) dest.write ('<!DOCTYPE ... >\n')
        dest.write ('<gnue:report-output xmlns:gnue="GNUe:Reports:Base"%s>\n' % 
ns)
+       
        dest.write ("  <gnue:report-request>\n")
        dest.write ( parameters.getRunOptionsAsXML() )
        dest.write ( sortoptions.getRunOptionsAsXML() )



reply via email to

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