commit-gnue
[Top][All Lists]
Advanced

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

gnue common/etc/sample.gnue.conf common/etc/sam...


From: Jason Cater
Subject: gnue common/etc/sample.gnue.conf common/etc/sam...
Date: Sun, 14 Apr 2002 16:20:43 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/04/14 16:20:43

Modified files:
        common/etc     : sample.gnue.conf sample.report-filters.conf 
        reports/adapters/destinations/email: sendmail.py 
        reports/adapters/destinations/fax: hylafax.py 
        reports/adapters/destinations/printer: bsd.py 
        reports/adapters/filters/sablotron: Adapter.py 
        reports/filters/SimpleTabulation: html.xsl 

Log message:
        fixes to make fax and printer support work; misc typo fixes

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/etc/sample.gnue.conf.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/etc/sample.report-filters.conf.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/adapters/destinations/email/sendmail.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/adapters/destinations/fax/hylafax.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/adapters/destinations/printer/bsd.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/adapters/filters/sablotron/Adapter.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/filters/SimpleTabulation/html.xsl.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: gnue/common/etc/sample.gnue.conf
diff -c gnue/common/etc/sample.gnue.conf:1.27 
gnue/common/etc/sample.gnue.conf:1.28
*** gnue/common/etc/sample.gnue.conf:1.27       Fri Apr 12 20:54:21 2002
--- gnue/common/etc/sample.gnue.conf    Sun Apr 14 16:20:42 2002
***************
*** 222,228 ****
  DefaultFilter = text
  
  # DestinationType Adapters
! PrinterAdapter = bsdlpr
  EmailAdapter = sendmail
  FileAdapter = text
  FaxAdapter = hylafax
--- 222,228 ----
  DefaultFilter = text
  
  # DestinationType Adapters
! PrinterAdapter = bsd
  EmailAdapter = sendmail
  FileAdapter = text
  FaxAdapter = hylafax
***************
*** 237,243 ****
  SendmailSubject = Your Requested Report
  
  # HylaFax sendfax binary (for FaxAdapter = hylafax)
! HylaFaxBin = /usr/bin/sendfax
  
  
  ##############################################################################
--- 237,244 ----
  SendmailSubject = Your Requested Report
  
  # HylaFax sendfax binary (for FaxAdapter = hylafax)
! HylaFaxCommand = /usr/bin/sendfax -m -d %s
! # HylaFaxCommand = /usr/bin/sendfax -n -h faxserver.mydomain.com -d %s
  
  
  ##############################################################################
Index: gnue/common/etc/sample.report-filters.conf
diff -c gnue/common/etc/sample.report-filters.conf:1.4 
gnue/common/etc/sample.report-filters.conf:1.5
*** gnue/common/etc/sample.report-filters.conf:1.4      Fri Apr 12 20:54:21 2002
--- gnue/common/etc/sample.report-filters.conf  Sun Apr 14 16:20:42 2002
***************
*** 9,14 ****
--- 9,15 ----
  engine = sablotron
  script = text.xsl
  mimetype = text/plain
+ extension = txt
  
  
  [testing:html]
***************
*** 16,21 ****
--- 17,23 ----
  engine = sablotron
  script = html.xsl
  mimetype = text/html
+ extension = html
  
  
  #
Index: gnue/reports/adapters/destinations/email/sendmail.py
diff -c gnue/reports/adapters/destinations/email/sendmail.py:1.2 
gnue/reports/adapters/destinations/email/sendmail.py:1.3
*** gnue/reports/adapters/destinations/email/sendmail.py:1.2    Fri Apr 12 
21:54:35 2002
--- gnue/reports/adapters/destinations/email/sendmail.py        Sun Apr 14 
16:20:42 2002
***************
*** 73,78 ****
--- 73,83 ----
  
      print mimetype
  
+     if _mimeFileTypes.has_key(mimetype):
+       fileExt = _mimeFileTypes[fileExt]
+     else:
+       fileExt = string.split(mimetype,'/')[-1]
+ 
      if self.usingHandle:
        self.input.close()
  
***************
*** 99,105 ****
  
      subwriter = mime.nextpart()
      subwriter.addheader("Content-Transfer-Encoding", "base64")
!     subwriter.addheader("Content-Disposition", "inline; filename=\"%s\"" % 
file)
      subwriter.startbody(mimetype)
  
      infile = open(file, 'r')
--- 104,110 ----
  
      subwriter = mime.nextpart()
      subwriter.addheader("Content-Transfer-Encoding", "base64")
!     subwriter.addheader("Content-Disposition", "inline; 
filename=\"Report.%s\"" % fileExt)
      subwriter.startbody(mimetype)
  
      infile = open(file, 'r')
***************
*** 112,118 ****
  
  
  
! # TODO: This is awefully redundant
  _mimeFileTypes = {
    'plain/text': 'txt',
    'plain/html': 'html',
--- 117,123 ----
  
  
  
! # TODO: This is awefully redundant... must be a better way!
  _mimeFileTypes = {
    'plain/text': 'txt',
    'plain/html': 'html',
Index: gnue/reports/adapters/destinations/fax/hylafax.py
diff -c gnue/reports/adapters/destinations/fax/hylafax.py:1.2 
gnue/reports/adapters/destinations/fax/hylafax.py:1.3
*** gnue/reports/adapters/destinations/fax/hylafax.py:1.2       Thu Apr 11 
00:19:30 2002
--- gnue/reports/adapters/destinations/fax/hylafax.py   Sun Apr 14 16:20:42 2002
***************
*** 19,28 ****
  # Copyright 2002 Free Software Foundation
  #
  # FILE:
! # email/sendmail.py
  #
  # DESCRIPTION:
! # Basic destination adapter for writing to sendmail
  #
  # NOTES:
  #
--- 19,28 ----
  # Copyright 2002 Free Software Foundation
  #
  # FILE:
! # fax/hylafax.py
  #
  # DESCRIPTION:
! # Basic destination adapter for writing to HylaFax's sendfax command
  #
  # NOTES:
  #
***************
*** 31,48 ****
  from gnue.reports import VERSION
  from gnue.reports.GROutputAdapter import DestinationAdapter as Base
  import sys, os, string
- from mimetools import choose_boundary
- from MimeWriter import MimeWriter
- import base64
  
- try:
-   from cStringIO import StringIO
- except ImportError:
-   from StringIO import StringIO
  
! 
! 
! class DestinationAdapter(_BaseAdapter):
  
    #
    # Typically, a transform adapter will call EITHER
--- 31,39 ----
  from gnue.reports import VERSION
  from gnue.reports.GROutputAdapter import DestinationAdapter as Base
  import sys, os, string
  
  
! class DestinationAdapter(Base):
  
    #
    # Typically, a transform adapter will call EITHER
***************
*** 75,84 ****
        self.input.close()
  
      file = self.tempfile
!     
      fax_to = string.replace(string.replace(self.destination, "`",""),';','')
  
!     os.system(GConfig.get('HylafaxBin',"/usr/bin/sendfax")+" -d '%s' %s" % 
(fax_to, file))
      self.deleteTempFile(self.tempfile)
  
  
--- 66,75 ----
        self.input.close()
  
      file = self.tempfile
! 
      fax_to = string.replace(string.replace(self.destination, "`",""),';','')
  
!     os.system(GConfig.get('HylafaxBin',"/usr/bin/sendfax -d %s")+" " % 
(fax_to) + file)
      self.deleteTempFile(self.tempfile)
  
  
Index: gnue/reports/adapters/destinations/printer/bsd.py
diff -c gnue/reports/adapters/destinations/printer/bsd.py:1.1 
gnue/reports/adapters/destinations/printer/bsd.py:1.2
*** gnue/reports/adapters/destinations/printer/bsd.py:1.1       Sat Apr  6 
20:20:36 2002
--- gnue/reports/adapters/destinations/printer/bsd.py   Sun Apr 14 16:20:43 2002
***************
*** 0 ****
--- 1,74 ----
+ #
+ # 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 2002 Free Software Foundation
+ #
+ # FILE:
+ # printer/bsd.py
+ #
+ # DESCRIPTION:
+ # Basic destination adapter for writing to BSD lpr
+ #
+ # NOTES:
+ #
+ 
+ from gnue.common import GConfig
+ from gnue.reports import VERSION
+ from gnue.reports.GROutputAdapter import DestinationAdapter as Base
+ import sys, os, string
+ 
+ 
+ class DestinationAdapter(Base):
+ 
+   #
+   # Typically, a transform adapter will call EITHER
+   # getOutputHandle or getOutputFile, not both.
+   #
+   # return a stream handle for outut by
+   # the transform adapter
+   #
+   def getOutputHandle(self):
+     self.usingHandle = 1
+     self.input, self.tempfile = self.createTempFile()
+     return self.input
+ 
+   #
+   # return a file name for outut by the
+   # transform adapter
+   #
+   def getOutputFile(self):
+     self.usingHandle = 0
+     self.input, self.tempfile = self.createTempFile()
+     self.input.close()
+     return self.tempfile
+ 
+   #
+   # Wrap up
+   #
+   def close(self, mimetype='plain/text'):
+ 
+     if self.usingHandle:
+       self.input.close()
+ 
+     file = self.tempfile
+ 
+     print_to = string.replace(string.replace(self.destination, "`",""),';','')
+ 
+     os.system((GConfig.get('LprCommand',"/usr/bin/lpr -P%s") + " %s") % 
(print_to, file))
+     self.deleteTempFile(self.tempfile)
+ 
Index: gnue/reports/adapters/filters/sablotron/Adapter.py
diff -c gnue/reports/adapters/filters/sablotron/Adapter.py:1.3 
gnue/reports/adapters/filters/sablotron/Adapter.py:1.4
*** gnue/reports/adapters/filters/sablotron/Adapter.py:1.3      Fri Apr 12 
21:54:35 2002
--- gnue/reports/adapters/filters/sablotron/Adapter.py  Sun Apr 14 16:20:43 2002
***************
*** 64,72 ****
      P = Sablot.Sablot()
  
      try:
!       mimetype = self.parameters['minetype']
      except:
        mimetype = 'text/plain'
  
      # Let the destination adapter do its thing
      self.destination.close(mimetype=mimetype)
--- 64,73 ----
      P = Sablot.Sablot()
  
      try:
!       mimetype = self.parameters['mimetype']
      except:
        mimetype = 'text/plain'
+ 
  
      # Let the destination adapter do its thing
      self.destination.close(mimetype=mimetype)
Index: gnue/reports/filters/SimpleTabulation/html.xsl
diff -c gnue/reports/filters/SimpleTabulation/html.xsl:1.4 
gnue/reports/filters/SimpleTabulation/html.xsl:1.5
*** gnue/reports/filters/SimpleTabulation/html.xsl:1.4  Fri Apr 12 16:56:53 2002
--- gnue/reports/filters/SimpleTabulation/html.xsl      Sun Apr 14 16:20:43 2002
***************
*** 3,10 ****
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:gnue="GNUe:Reports:Base"
    xmlns:t="GNUe:Reports:SimpleTabulation"
    version="1.0">
! <!--  exclude-result-prefixes="gnue" -->
  <xsl:output method="html"/>
  <xsl:template match="/">
    <html>
--- 3,11 ----
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:gnue="GNUe:Reports:Base"
    xmlns:t="GNUe:Reports:SimpleTabulation"
+   exclude-result-prefixes="gnue t"
    version="1.0">
!   
  <xsl:output method="html"/>
  <xsl:template match="/">
    <html>



reply via email to

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