src/reportlab/graphics/barcode/test.py
changeset 4551 d357e2acc856
parent 4294 55c8019c775e
equal deleted inserted replaced
4550:80dd9e83dad9 4551:d357e2acc856
     1 #!/usr/pkg/bin/python
     1 #!/usr/pkg/bin/python
     2 
     2 
     3 import os, sys, time
     3 import os, sys, time
     4 
     4 
       
     5 from reportlab import Version as __RL_Version__
     5 from reportlab.graphics.barcode.common import *
     6 from reportlab.graphics.barcode.common import *
     6 from reportlab.graphics.barcode.code39 import *
     7 from reportlab.graphics.barcode.code39 import *
     7 from reportlab.graphics.barcode.code93 import *
     8 from reportlab.graphics.barcode.code93 import *
     8 from reportlab.graphics.barcode.code128 import *
     9 from reportlab.graphics.barcode.code128 import *
     9 from reportlab.graphics.barcode.usps import *
    10 from reportlab.graphics.barcode.usps import *
   146     styleN = styles['Normal']
   147     styleN = styles['Normal']
   147     styleH = styles['Heading1']
   148     styleH = styles['Heading1']
   148     styleH2 = styles['Heading2']
   149     styleH2 = styles['Heading2']
   149     story = []
   150     story = []
   150 
   151 
   151     story.append(Paragraph('ReportLab Barcode Test Suite - full output', styleH))
   152     story.append(Paragraph('ReportLab %s Barcode Test Suite - full output' % __RL_Version__,styleH))
   152     story.append(Paragraph('Generated on %s' % time.ctime(time.time()), styleN))
   153     story.append(Paragraph('Generated at %s' % time.ctime(time.time()), styleN))
   153 
   154 
   154     story.append(Paragraph('', styleN))
       
   155     story.append(Paragraph('Repository information for this build:', styleN))
       
   156     #see if we can figure out where it was built, if we're running in source
       
   157     if os.path.split(os.getcwd())[-1] == 'barcode' and os.path.isdir('.svn'):
       
   158         #runnning in a filesystem svn copy
       
   159         infoLines = os.popen('svn info').read()
       
   160         story.append(Preformatted(infoLines, styles["Code"]))
       
   161         
       
   162     story.append(Paragraph('About this document', styleH2))
   155     story.append(Paragraph('About this document', styleH2))
   163     story.append(Paragraph('History and Status', styleH2))
   156     story.append(Paragraph('History and Status', styleH2))
   164 
   157 
   165     story.append(Paragraph("""
   158     story.append(Paragraph("""
   166         This is the test suite and docoumentation for the ReportLab open source barcode API,
   159         This is the test suite and docoumentation for the ReportLab open source barcode API.
   167         being re-released as part of the forthcoming ReportLab 2.0 release.
       
   168         """, styleN))
   160         """, styleN))
   169 
   161 
   170     story.append(Paragraph("""
   162     story.append(Paragraph("""
   171         Several years ago Ty Sarna contributed a barcode module to the ReportLab community.
   163         Several years ago Ty Sarna contributed a barcode module to the ReportLab community.
   172         Several of the codes were used by him in hiw work and to the best of our knowledge
   164         Several of the codes were used by him in hiw work and to the best of our knowledge