diff --git a/core/src/test/resources/blackbox/rssexpanded-3/generate.py b/core/src/test/resources/blackbox/rssexpanded-3/generate.py deleted file mode 100644 index 5ec05c441..000000000 --- a/core/src/test/resources/blackbox/rssexpanded-3/generate.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python - -import os -import glob -import sys -import subprocess -import traceback -import hashlib -import urllib -import urllib2 - -ZINT = 'zint' -ZINT_RSS_EXPANDED_CODE = 31 -ZINT_BINARY = "zint" # If available in PATH - -POSTSCRIPT = 'postscript' - -TEST_FILE = "../../../src/com/google/zxing/oned/rss/RSSExpandedBlackBox3TestCase.java" - -def check_zint(): - try: - subprocess.Popen("zint", stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except: - print >> sys.stderr, "zint not installed. Go to http://www.zint.org.uk/ and install it" - return False - return True - -def check_postscript(): - return True - -GENERATORS = [] -if check_zint(): - GENERATORS.append(ZINT) -if check_postscript(): - GENERATORS.append(POSTSCRIPT) - -def generate_image_zint(image_filename, barcode): - braces_barcode = barcode.replace("(","[").replace(")","]") - os.system('%s -o %s -b %s -d "%s"' % (ZINT_BINARY, image_filename, ZINT_RSS_EXPANDED_CODE, braces_barcode.replace('"','\\"'))) - -def generate_image_postscript(image_filename, barcode): - hashname = "cache/%s.png" % hashlib.new("md5", barcode).hexdigest() - # If it exists in the cache, don't download it - if os.path.exists(hashname): - content = open(hashname).read() - open(image_filename,'w').write(content) - return - - # We tried use the Python, Perl and LaTeX bindings without success :-( - baseurl = "http://www.terryburton.co.uk/barcodewriter/generator/" - encoded = urllib.urlencode({ - "encoder" : "rssexpanded", - "data" : barcode, - "options" : "", - "translate_x" : "50", "translate_y" : "50", - "scale_x" : "2", "scale_y" : "2", - "rotate" : "0", "submit" : "Make Barcode" - }) - web_urlobject = urllib2.urlopen(baseurl, data = encoded) - web_content = web_urlobject.read() - png_url = web_content.split('">PNG')[0].split('1234 -(10)1098?1234 -(10)1098_1234 -(10)1098 1234 - -# Testing transitions - -(10)123456A # numeric -> alpha --zint-(10)123456A1 # numeric -> alpha --zint-(10)123456A123 # numeric -> alpha -(10)123456A1234 # numeric -> alpha -> numeric -(10)123456A1234A # numeric -> alpha -(10)123456A123456 # numeric -> alpha -> numeric -(10)123456A12345678 # numeric -> alpha -> numeric --zint-(10)123456A1234A(15)991231 # numeric -> alpha -> FNC1 - -(10)1ABCDEF;:/1234567 # numeric -> alpha -> 646 -> numeric -(10)1ABCDEF;:/ABCDEFG # numeric -> alpha -> 646 -> alpha - -(10)1;:/ABCDEFGHIJKLM # numeric -> 646 -> alpha -(10)1;:/0123456789012 # numeric -> 646 -> numeric -(10)1;:/0123 # numeric -> 646 -(10)1;:/0123(15)991231 # numeric -> 646 -> FNC1 numeric - -# Another tests, from 7.2.5.5.2 --zint-(10)1 - -# Another bug in zint, it works with http://www.terryburton.co.uk/barcodewriter/generator/ --zint-(10)12A -# Another bug in zint, it works with the http://www.terryburton.co.uk/barcodewriter/generator/ --zint-(10)123 -