diff --git a/setup/SE/bin/activate b/setup/SE/bin/activate new file mode 100644 index 0000000..c3cc38c --- /dev/null +++ b/setup/SE/bin/activate @@ -0,0 +1,78 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + unset -f pydoc >/dev/null 2>&1 + + # reset old environment variables + # ! [ -z ${VAR+_} ] returns true if VAR is declared at all + if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then + PATH="$_OLD_VIRTUAL_PATH" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then + PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then + hash -r 2>/dev/null + fi + + if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then + PS1="$_OLD_VIRTUAL_PS1" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + if [ ! "${1-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +if ! [ -z "${PYTHONHOME+_}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then + _OLD_VIRTUAL_PS1="$PS1" + if [ "x" != x ] ; then + PS1="$PS1" + else + PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1" + fi + export PS1 +fi + +# Make sure to unalias pydoc if it's already there +alias pydoc 2>/dev/null >/dev/null && unalias pydoc + +pydoc () { + python -m pydoc "$@" +} + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then + hash -r 2>/dev/null +fi diff --git a/setup/SE/bin/activate.csh b/setup/SE/bin/activate.csh new file mode 100644 index 0000000..850251a --- /dev/null +++ b/setup/SE/bin/activate.csh @@ -0,0 +1,36 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + + +if ("" != "") then + set env_name = "" +else + set env_name = `basename "$VIRTUAL_ENV"` +endif + +# Could be in a non-interactive environment, +# in which case, $prompt is undefined and we wouldn't +# care about the prompt anyway. +if ( $?prompt ) then + set _OLD_VIRTUAL_PROMPT="$prompt" + set prompt = "[$env_name] $prompt" +endif + +unset env_name + +alias pydoc python -m pydoc + +rehash + diff --git a/setup/SE/bin/activate.fish b/setup/SE/bin/activate.fish new file mode 100644 index 0000000..d1cee7c --- /dev/null +++ b/setup/SE/bin/activate.fish @@ -0,0 +1,76 @@ +# This file must be used using `. bin/activate.fish` *within a running fish ( http://fishshell.com ) session*. +# Do not run it directly. + +function deactivate -d 'Exit virtualenv mode and return to the normal environment.' + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + # Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`. + set -l fish_function_path + + # Erase virtualenv's `fish_prompt` and restore the original. + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + end + + set -e VIRTUAL_ENV + + if test "$argv[1]" != 'nondestructive' + # Self-destruct! + functions -e pydoc + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV "/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# Unset `$PYTHONHOME` if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +function pydoc + python -m pydoc $argv +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # Copy the current `fish_prompt` function as `_old_fish_prompt`. + functions -c fish_prompt _old_fish_prompt + + function fish_prompt + # Save the current $status, for fish_prompts that display it. + set -l old_status $status + + # Prompt override provided? + # If not, just prepend the environment name. + if test -n "" + printf '%s%s' "" (set_color normal) + else + printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV") + end + + # Restore the original $status + echo "exit $old_status" | source + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/setup/SE/bin/activate_this.py b/setup/SE/bin/activate_this.py new file mode 100644 index 0000000..f18193b --- /dev/null +++ b/setup/SE/bin/activate_this.py @@ -0,0 +1,34 @@ +"""By using execfile(this_file, dict(__file__=this_file)) you will +activate this virtualenv environment. + +This can be used when you must use an existing Python interpreter, not +the virtualenv bin/python +""" + +try: + __file__ +except NameError: + raise AssertionError( + "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))") +import sys +import os + +old_os_path = os.environ.get('PATH', '') +os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path +base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +if sys.platform == 'win32': + site_packages = os.path.join(base, 'Lib', 'site-packages') +else: + site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages') +prev_sys_path = list(sys.path) +import site +site.addsitedir(site_packages) +sys.real_prefix = sys.prefix +sys.prefix = base +# Move the added items to the front of the path: +new_sys_path = [] +for item in list(sys.path): + if item not in prev_sys_path: + new_sys_path.append(item) + sys.path.remove(item) +sys.path[:0] = new_sys_path diff --git a/setup/SE/bin/chardetect b/setup/SE/bin/chardetect new file mode 100755 index 0000000..aa822f3 --- /dev/null +++ b/setup/SE/bin/chardetect @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from chardet.cli.chardetect import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/coverage b/setup/SE/bin/coverage new file mode 100755 index 0000000..848ff96 --- /dev/null +++ b/setup/SE/bin/coverage @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from coverage.cmdline import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/coverage-2.7 b/setup/SE/bin/coverage-2.7 new file mode 100755 index 0000000..848ff96 --- /dev/null +++ b/setup/SE/bin/coverage-2.7 @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from coverage.cmdline import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/coverage2 b/setup/SE/bin/coverage2 new file mode 100755 index 0000000..848ff96 --- /dev/null +++ b/setup/SE/bin/coverage2 @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from coverage.cmdline import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/coveralls b/setup/SE/bin/coveralls new file mode 100755 index 0000000..5407d63 --- /dev/null +++ b/setup/SE/bin/coveralls @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from coveralls.cli import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/docx2txt b/setup/SE/bin/docx2txt new file mode 100755 index 0000000..f479af4 --- /dev/null +++ b/setup/SE/bin/docx2txt @@ -0,0 +1,9 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +import docx2txt + +if __name__ == '__main__': + import sys + args = docx2txt.process_args() + text = docx2txt.process(args.docx, args.img_dir) + sys.stdout.write(text.encode('utf-8')) diff --git a/setup/SE/bin/dumppdf.py b/setup/SE/bin/dumppdf.py new file mode 100755 index 0000000..3a850f5 --- /dev/null +++ b/setup/SE/bin/dumppdf.py @@ -0,0 +1,268 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 +# +# dumppdf.py - dump pdf contents in XML format. +# +# usage: dumppdf.py [options] [files ...] +# options: +# -i objid : object id +# +import sys, os.path, re +from pdfminer.psparser import PSKeyword, PSLiteral, LIT +from pdfminer.pdfparser import PDFParser +from pdfminer.pdfdocument import PDFDocument, PDFNoOutlines +from pdfminer.pdftypes import PDFObjectNotFound, PDFValueError +from pdfminer.pdftypes import PDFStream, PDFObjRef, resolve1, stream_value +from pdfminer.pdfpage import PDFPage +from pdfminer.utils import isnumber + + +ESC_PAT = re.compile(r'[\000-\037&<>()"\042\047\134\177-\377]') +def e(s): + return ESC_PAT.sub(lambda m:'&#%d;' % ord(m.group(0)), s) + + +# dumpxml +def dumpxml(out, obj, codec=None): + if obj is None: + out.write('') + return + + if isinstance(obj, dict): + out.write('\n' % len(obj)) + for (k,v) in obj.iteritems(): + out.write('%s\n' % k) + out.write('') + dumpxml(out, v) + out.write('\n') + out.write('') + return + + if isinstance(obj, list): + out.write('\n' % len(obj)) + for v in obj: + dumpxml(out, v) + out.write('\n') + out.write('') + return + + if isinstance(obj, str): + out.write('%s' % (len(obj), e(obj))) + return + + if isinstance(obj, PDFStream): + if codec == 'raw': + out.write(obj.get_rawdata()) + elif codec == 'binary': + out.write(obj.get_data()) + else: + out.write('\n\n') + dumpxml(out, obj.attrs) + out.write('\n\n') + if codec == 'text': + data = obj.get_data() + out.write('%s\n' % (len(data), e(data))) + out.write('') + return + + if isinstance(obj, PDFObjRef): + out.write('' % obj.objid) + return + + if isinstance(obj, PSKeyword): + out.write('%s' % obj.name) + return + + if isinstance(obj, PSLiteral): + out.write('%s' % obj.name) + return + + if isnumber(obj): + out.write('%s' % obj) + return + + raise TypeError(obj) + +# dumptrailers +def dumptrailers(out, doc): + for xref in doc.xrefs: + out.write('\n') + dumpxml(out, xref.trailer) + out.write('\n\n\n') + return + +# dumpallobjs +def dumpallobjs(out, doc, codec=None): + visited = set() + out.write('') + for xref in doc.xrefs: + for objid in xref.get_objids(): + if objid in visited: continue + visited.add(objid) + try: + obj = doc.getobj(objid) + if obj is None: continue + out.write('\n' % objid) + dumpxml(out, obj, codec=codec) + out.write('\n\n\n') + except PDFObjectNotFound, e: + print >>sys.stderr, 'not found: %r' % e + dumptrailers(out, doc) + out.write('') + return + +# dumpoutline +def dumpoutline(outfp, fname, objids, pagenos, password='', + dumpall=False, codec=None, extractdir=None): + fp = file(fname, 'rb') + parser = PDFParser(fp) + doc = PDFDocument(parser, password) + pages = dict( (page.pageid, pageno) for (pageno,page) + in enumerate(PDFPage.create_pages(doc)) ) + def resolve_dest(dest): + if isinstance(dest, str): + dest = resolve1(doc.get_dest(dest)) + elif isinstance(dest, PSLiteral): + dest = resolve1(doc.get_dest(dest.name)) + if isinstance(dest, dict): + dest = dest['D'] + return dest + try: + outlines = doc.get_outlines() + outfp.write('\n') + for (level,title,dest,a,se) in outlines: + pageno = None + if dest: + dest = resolve_dest(dest) + pageno = pages[dest[0].objid] + elif a: + action = a.resolve() + if isinstance(action, dict): + subtype = action.get('S') + if subtype and repr(subtype) == '/GoTo' and action.get('D'): + dest = resolve_dest(action['D']) + pageno = pages[dest[0].objid] + s = e(title).encode('utf-8', 'xmlcharrefreplace') + outfp.write('\n' % (level, s)) + if dest is not None: + outfp.write('') + dumpxml(outfp, dest) + outfp.write('\n') + if pageno is not None: + outfp.write('%r\n' % pageno) + outfp.write('\n') + outfp.write('\n') + except PDFNoOutlines: + pass + parser.close() + fp.close() + return + +# extractembedded +LITERAL_FILESPEC = LIT('Filespec') +LITERAL_EMBEDDEDFILE = LIT('EmbeddedFile') +def extractembedded(outfp, fname, objids, pagenos, password='', + dumpall=False, codec=None, extractdir=None): + def extract1(obj): + filename = os.path.basename(obj['UF'] or obj['F']) + fileref = obj['EF']['F'] + fileobj = doc.getobj(fileref.objid) + if not isinstance(fileobj, PDFStream): + raise PDFValueError( + 'unable to process PDF: reference for %r is not a PDFStream' % + (filename)) + if fileobj.get('Type') is not LITERAL_EMBEDDEDFILE: + raise PDFValueError( + 'unable to process PDF: reference for %r is not an EmbeddedFile' % + (filename)) + path = os.path.join(extractdir, filename) + if os.path.exists(path): + raise IOError('file exists: %r' % path) + print >>sys.stderr, 'extracting: %r' % path + out = file(path, 'wb') + out.write(fileobj.get_data()) + out.close() + return + + fp = file(fname, 'rb') + parser = PDFParser(fp) + doc = PDFDocument(parser, password) + for xref in doc.xrefs: + for objid in xref.get_objids(): + obj = doc.getobj(objid) + if isinstance(obj, dict) and obj.get('Type') is LITERAL_FILESPEC: + extract1(obj) + return + +# dumppdf +def dumppdf(outfp, fname, objids, pagenos, password='', + dumpall=False, codec=None, extractdir=None): + fp = file(fname, 'rb') + parser = PDFParser(fp) + doc = PDFDocument(parser, password) + if objids: + for objid in objids: + obj = doc.getobj(objid) + dumpxml(outfp, obj, codec=codec) + if pagenos: + for (pageno,page) in enumerate(PDFPage.create_pages(doc)): + if pageno in pagenos: + if codec: + for obj in page.contents: + obj = stream_value(obj) + dumpxml(outfp, obj, codec=codec) + else: + dumpxml(outfp, page.attrs) + if dumpall: + dumpallobjs(outfp, doc, codec=codec) + if (not objids) and (not pagenos) and (not dumpall): + dumptrailers(outfp, doc) + fp.close() + if codec not in ('raw','binary'): + outfp.write('\n') + return + + +# main +def main(argv): + import getopt + def usage(): + print 'usage: %s [-d] [-a] [-p pageid] [-P password] [-r|-b|-t] [-T] [-E directory] [-i objid] file ...' % argv[0] + return 100 + try: + (opts, args) = getopt.getopt(argv[1:], 'dap:P:rbtTE:i:') + except getopt.GetoptError: + return usage() + if not args: return usage() + debug = 0 + objids = [] + pagenos = set() + codec = None + password = '' + dumpall = False + proc = dumppdf + outfp = sys.stdout + extractdir = None + for (k, v) in opts: + if k == '-d': debug += 1 + elif k == '-o': outfp = file(v, 'wb') + elif k == '-i': objids.extend( int(x) for x in v.split(',') ) + elif k == '-p': pagenos.update( int(x)-1 for x in v.split(',') ) + elif k == '-P': password = v + elif k == '-a': dumpall = True + elif k == '-r': codec = 'raw' + elif k == '-b': codec = 'binary' + elif k == '-t': codec = 'text' + elif k == '-T': proc = dumpoutline + elif k == '-E': + extractdir = v + proc = extractembedded + # + PDFDocument.debug = debug + PDFParser.debug = debug + # + for fname in args: + proc(outfp, fname, objids, pagenos, password=password, + dumpall=dumpall, codec=codec, extractdir=extractdir) + return + +if __name__ == '__main__': sys.exit(main(sys.argv)) diff --git a/setup/SE/bin/easy_install b/setup/SE/bin/easy_install new file mode 100755 index 0000000..1cebc46 --- /dev/null +++ b/setup/SE/bin/easy_install @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from setuptools.command.easy_install import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/easy_install-2.7 b/setup/SE/bin/easy_install-2.7 new file mode 100755 index 0000000..1cebc46 --- /dev/null +++ b/setup/SE/bin/easy_install-2.7 @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from setuptools.command.easy_install import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/latin2ascii.py b/setup/SE/bin/latin2ascii.py new file mode 100755 index 0000000..988f4ce --- /dev/null +++ b/setup/SE/bin/latin2ascii.py @@ -0,0 +1,130 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 +# +# latin2ascii.py - converts latin1 characters into ascii. +# + +import sys + +""" Mappings from Latin-1 characters to ASCII. + +This is an in-house mapping table for some Latin-1 characters +(acutes, umlauts, etc.) to ASCII strings. +""" + +LATIN2ASCII = { + #0x00a0: '', + #0x00a7: '', + + # iso-8859-1 + 0x00c0: 'A`', + 0x00c1: "A'", + 0x00c2: 'A^', + 0x00c3: 'A~', + 0x00c4: 'A:', + 0x00c5: 'A%', + 0x00c6: 'AE', + 0x00c7: 'C,', + 0x00c8: 'E`', + 0x00c9: "E'", + 0x00ca: 'E^', + 0x00cb: 'E:', + 0x00cc: 'I`', + 0x00cd: "I'", + 0x00ce: 'I^', + 0x00cf: 'I:', + 0x00d0: "D'", + 0x00d1: 'N~', + 0x00d2: 'O`', + 0x00d3: "O'", + 0x00d4: 'O^', + 0x00d5: 'O~', + 0x00d6: 'O:', + 0x00d8: 'O/', + 0x00d9: 'U`', + 0x00da: "U'", + 0x00db: 'U~', + 0x00dc: 'U:', + 0x00dd: "Y'", + 0x00df: 'ss', + + 0x00e0: 'a`', + 0x00e1: "a'", + 0x00e2: 'a^', + 0x00e3: 'a~', + 0x00e4: 'a:', + 0x00e5: 'a%', + 0x00e6: 'ae', + 0x00e7: 'c,', + 0x00e8: 'e`', + 0x00e9: "e'", + 0x00ea: 'e^', + 0x00eb: 'e:', + 0x00ec: 'i`', + 0x00ed: "i'", + 0x00ee: 'i^', + 0x00ef: 'i:', + 0x00f0: "d'", + 0x00f1: 'n~', + 0x00f2: 'o`', + 0x00f3: "o'", + 0x00f4: 'o^', + 0x00f5: 'o~', + 0x00f6: 'o:', + 0x00f8: 'o/', + 0x00f9: 'o`', + 0x00fa: "u'", + 0x00fb: 'u~', + 0x00fc: 'u:', + 0x00fd: "y'", + 0x00ff: 'y:', + + # Ligatures + 0x0152: 'OE', + 0x0153: 'oe', + 0x0132: 'IJ', + 0x0133: 'ij', + 0x1d6b: 'ue', + 0xfb00: 'ff', + 0xfb01: 'fi', + 0xfb02: 'fl', + 0xfb03: 'ffi', + 0xfb04: 'ffl', + 0xfb05: 'ft', + 0xfb06: 'st', + + # Symbols + #0x2013: '', + 0x2014: '--', + 0x2015: '||', + 0x2018: '`', + 0x2019: "'", + 0x201c: '``', + 0x201d: "''", + #0x2022: '', + #0x2212: '', + +} + +def latin2ascii(s): + return ''.join( LATIN2ASCII.get(ord(c),c) for c in s ) + + +def main(argv): + import getopt, fileinput + def usage(): + print 'usage: %s [-c codec] file ...' % argv[0] + return 100 + try: + (opts, args) = getopt.getopt(argv[1:], 'c') + except getopt.GetoptError: + return usage() + if not args: return usage() + codec = 'utf-8' + for (k, v) in opts: + if k == '-c': codec = v + for line in fileinput.input(args): + line = latin2ascii(unicode(line, codec, 'ignore')) + sys.stdout.write(line.encode('ascii', 'replace')) + return + +if __name__ == '__main__': sys.exit(main(sys.argv)) diff --git a/setup/SE/bin/nosetests b/setup/SE/bin/nosetests new file mode 100755 index 0000000..ed5a32c --- /dev/null +++ b/setup/SE/bin/nosetests @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from nose import run_exit + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(run_exit()) diff --git a/setup/SE/bin/nosetests-2.7 b/setup/SE/bin/nosetests-2.7 new file mode 100755 index 0000000..ed5a32c --- /dev/null +++ b/setup/SE/bin/nosetests-2.7 @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from nose import run_exit + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(run_exit()) diff --git a/setup/SE/bin/pdf2txt.py b/setup/SE/bin/pdf2txt.py new file mode 100755 index 0000000..aa15a60 --- /dev/null +++ b/setup/SE/bin/pdf2txt.py @@ -0,0 +1,115 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 +import sys +from pdfminer.pdfdocument import PDFDocument +from pdfminer.pdfparser import PDFParser +from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter +from pdfminer.pdfdevice import PDFDevice, TagExtractor +from pdfminer.pdfpage import PDFPage +from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter +from pdfminer.cmapdb import CMapDB +from pdfminer.layout import LAParams +from pdfminer.image import ImageWriter + +# main +def main(argv): + import getopt + def usage(): + print ('usage: %s [-d] [-p pagenos] [-m maxpages] [-P password] [-o output]' + ' [-C] [-n] [-A] [-V] [-M char_margin] [-L line_margin] [-W word_margin]' + ' [-F boxes_flow] [-Y layout_mode] [-O output_dir] [-R rotation]' + ' [-t text|html|xml|tag] [-c codec] [-s scale]' + ' file ...' % argv[0]) + return 100 + try: + (opts, args) = getopt.getopt(argv[1:], 'dp:m:P:o:CnAVM:L:W:F:Y:O:R:t:c:s:') + except getopt.GetoptError: + return usage() + if not args: return usage() + # debug option + debug = 0 + # input option + password = '' + pagenos = set() + maxpages = 0 + # output option + outfile = None + outtype = None + imagewriter = None + rotation = 0 + layoutmode = 'normal' + codec = 'utf-8' + pageno = 1 + scale = 1 + caching = True + showpageno = True + laparams = LAParams() + for (k, v) in opts: + if k == '-d': debug += 1 + elif k == '-p': pagenos.update( int(x)-1 for x in v.split(',') ) + elif k == '-m': maxpages = int(v) + elif k == '-P': password = v + elif k == '-o': outfile = v + elif k == '-C': caching = False + elif k == '-n': laparams = None + elif k == '-A': laparams.all_texts = True + elif k == '-V': laparams.detect_vertical = True + elif k == '-M': laparams.char_margin = float(v) + elif k == '-L': laparams.line_margin = float(v) + elif k == '-W': laparams.word_margin = float(v) + elif k == '-F': laparams.boxes_flow = float(v) + elif k == '-Y': layoutmode = v + elif k == '-O': imagewriter = ImageWriter(v) + elif k == '-R': rotation = int(v) + elif k == '-t': outtype = v + elif k == '-c': codec = v + elif k == '-s': scale = float(v) + # + PDFDocument.debug = debug + PDFParser.debug = debug + CMapDB.debug = debug + PDFResourceManager.debug = debug + PDFPageInterpreter.debug = debug + PDFDevice.debug = debug + # + rsrcmgr = PDFResourceManager(caching=caching) + if not outtype: + outtype = 'text' + if outfile: + if outfile.endswith('.htm') or outfile.endswith('.html'): + outtype = 'html' + elif outfile.endswith('.xml'): + outtype = 'xml' + elif outfile.endswith('.tag'): + outtype = 'tag' + if outfile: + outfp = file(outfile, 'w') + else: + outfp = sys.stdout + if outtype == 'text': + device = TextConverter(rsrcmgr, outfp, codec=codec, laparams=laparams, + imagewriter=imagewriter) + elif outtype == 'xml': + device = XMLConverter(rsrcmgr, outfp, codec=codec, laparams=laparams, + imagewriter=imagewriter) + elif outtype == 'html': + device = HTMLConverter(rsrcmgr, outfp, codec=codec, scale=scale, + layoutmode=layoutmode, laparams=laparams, + imagewriter=imagewriter) + elif outtype == 'tag': + device = TagExtractor(rsrcmgr, outfp, codec=codec) + else: + return usage() + for fname in args: + fp = file(fname, 'rb') + interpreter = PDFPageInterpreter(rsrcmgr, device) + for page in PDFPage.get_pages(fp, pagenos, + maxpages=maxpages, password=password, + caching=caching, check_extractable=True): + page.rotate = (page.rotate+rotation) % 360 + interpreter.process_page(page) + fp.close() + device.close() + outfp.close() + return + +if __name__ == '__main__': sys.exit(main(sys.argv)) diff --git a/setup/SE/bin/pip b/setup/SE/bin/pip new file mode 100755 index 0000000..e0faf73 --- /dev/null +++ b/setup/SE/bin/pip @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from pip._internal import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/pip2 b/setup/SE/bin/pip2 new file mode 100755 index 0000000..e0faf73 --- /dev/null +++ b/setup/SE/bin/pip2 @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from pip._internal import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/pip2.7 b/setup/SE/bin/pip2.7 new file mode 100755 index 0000000..e0faf73 --- /dev/null +++ b/setup/SE/bin/pip2.7 @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from pip._internal import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/python b/setup/SE/bin/python new file mode 120000 index 0000000..551ab26 --- /dev/null +++ b/setup/SE/bin/python @@ -0,0 +1 @@ +python2 \ No newline at end of file diff --git a/setup/SE/bin/python-config b/setup/SE/bin/python-config new file mode 100755 index 0000000..7e68234 --- /dev/null +++ b/setup/SE/bin/python-config @@ -0,0 +1,78 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python + +import sys +import getopt +import sysconfig + +valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', + 'ldflags', 'help'] + +if sys.version_info >= (3, 2): + valid_opts.insert(-1, 'extension-suffix') + valid_opts.append('abiflags') +if sys.version_info >= (3, 3): + valid_opts.append('configdir') + + +def exit_with_usage(code=1): + sys.stderr.write("Usage: {0} [{1}]\n".format( + sys.argv[0], '|'.join('--'+opt for opt in valid_opts))) + sys.exit(code) + +try: + opts, args = getopt.getopt(sys.argv[1:], '', valid_opts) +except getopt.error: + exit_with_usage() + +if not opts: + exit_with_usage() + +pyver = sysconfig.get_config_var('VERSION') +getvar = sysconfig.get_config_var + +opt_flags = [flag for (flag, val) in opts] + +if '--help' in opt_flags: + exit_with_usage(code=0) + +for opt in opt_flags: + if opt == '--prefix': + print(sysconfig.get_config_var('prefix')) + + elif opt == '--exec-prefix': + print(sysconfig.get_config_var('exec_prefix')) + + elif opt in ('--includes', '--cflags'): + flags = ['-I' + sysconfig.get_path('include'), + '-I' + sysconfig.get_path('platinclude')] + if opt == '--cflags': + flags.extend(getvar('CFLAGS').split()) + print(' '.join(flags)) + + elif opt in ('--libs', '--ldflags'): + abiflags = getattr(sys, 'abiflags', '') + libs = ['-lpython' + pyver + abiflags] + libs += getvar('LIBS').split() + libs += getvar('SYSLIBS').split() + # add the prefix/lib/pythonX.Y/config dir, but only if there is no + # shared library in prefix/lib/. + if opt == '--ldflags': + if not getvar('Py_ENABLE_SHARED'): + libs.insert(0, '-L' + getvar('LIBPL')) + if not getvar('PYTHONFRAMEWORK'): + libs.extend(getvar('LINKFORSHARED').split()) + print(' '.join(libs)) + + elif opt == '--extension-suffix': + ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') + if ext_suffix is None: + ext_suffix = sysconfig.get_config_var('SO') + print(ext_suffix) + + elif opt == '--abiflags': + if not getattr(sys, 'abiflags', None): + exit_with_usage() + print(sys.abiflags) + + elif opt == '--configdir': + print(sysconfig.get_config_var('LIBPL')) diff --git a/setup/SE/bin/python2 b/setup/SE/bin/python2 new file mode 100755 index 0000000..7029d9f Binary files /dev/null and b/setup/SE/bin/python2 differ diff --git a/setup/SE/bin/python2.7 b/setup/SE/bin/python2.7 new file mode 120000 index 0000000..551ab26 --- /dev/null +++ b/setup/SE/bin/python2.7 @@ -0,0 +1 @@ +python2 \ No newline at end of file diff --git a/setup/SE/bin/vba_extract.py b/setup/SE/bin/vba_extract.py new file mode 100755 index 0000000..cd7c2e1 --- /dev/null +++ b/setup/SE/bin/vba_extract.py @@ -0,0 +1,68 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +############################################################################## +# +# vba_extract - A simple utility to extract a vbaProject.bin binary from an +# Excel 2007+ xlsm file for insertion into an XlsxWriter file. +# +# Copyright 2013-2017, John McNamara, jmcnamara@cpan.org +# +import sys +import shutil +from zipfile import ZipFile +from zipfile import BadZipfile + +# The VBA project file we want to extract. +vba_filename = 'vbaProject.bin' + +# Get the xlsm file name from the commandline. +if len(sys.argv) > 1: + xlsm_file = sys.argv[1] +else: + print("\nUtility to extract a vbaProject.bin binary from an Excel 2007+ " + "xlsm macro file for insertion into an XlsxWriter file." + "\n" + "See: https://xlsxwriter.readthedocs.io/working_with_macros.html\n" + "\n" + "Usage: vba_extract file.xlsm\n") + exit() + +try: + # Open the Excel xlsm file as a zip file. + xlsm_zip = ZipFile(xlsm_file, 'r') + + # Read the xl/vbaProject.bin file. + vba_data = xlsm_zip.read('xl/' + vba_filename) + + # Write the vba data to a local file. + vba_file = open(vba_filename, "wb") + vba_file.write(vba_data) + vba_file.close() + +except IOError: + # Use exc_info() for Python 2.5+ compatibility. + e = sys.exc_info()[1] + print("File error: %s" % str(e)) + exit() + +except KeyError: + # Usually when there isn't a xl/vbaProject.bin member in the file. + e = sys.exc_info()[1] + print("File error: %s" % str(e)) + print("File may not be an Excel xlsm macro file: '%s'" % xlsm_file) + exit() + +except BadZipfile: + # Usually if the file is an xls file and not an xlsm file. + e = sys.exc_info()[1] + print("File error: %s: '%s'" % (str(e), xlsm_file)) + print("File may not be an Excel xlsm macro file.") + exit() + +except: + # Catch any other exceptions. + e = sys.exc_info()[1] + print("File error: %s" % str(e)) + exit() + +print("Extracted: %s" % vba_filename) diff --git a/setup/SE/bin/wheel b/setup/SE/bin/wheel new file mode 100755 index 0000000..76e6eeb --- /dev/null +++ b/setup/SE/bin/wheel @@ -0,0 +1,11 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 + +# -*- coding: utf-8 -*- +import re +import sys + +from wheel.tool import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/setup/SE/bin/xlsx2csv b/setup/SE/bin/xlsx2csv new file mode 100755 index 0000000..1d26535 --- /dev/null +++ b/setup/SE/bin/xlsx2csv @@ -0,0 +1,967 @@ +#!/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin/python2 +# +# Copyright information +# +# Copyright (C) 2010-2012 Dilshod Temirkhodjaev +# +# License +# +# This program 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 of the License, or +# (at your option) any later version. +# +# This program 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 this program. If not, see . + +__author__ = "Dilshod Temirkhodjaev " +__license__ = "GPL-2+" +__version__ = "0.7.3" + +import csv, datetime, zipfile, string, sys, os, re, signal +import xml.parsers.expat +from xml.dom import minidom +try: + # python2.4 + from cStringIO import StringIO +except: + pass +try: + from argparse import ArgumentParser +except: + # python2.4 + from optparse import OptionParser + +# see also ruby-roo lib at: https://github.com/hmcgowan/roo +FORMATS = { + 'general' : 'float', + '0' : 'float', + '0.00' : 'float', + '#,##0' : 'float', + '#,##0.00' : 'float', + '0%' : 'percentage', + '0.00%' : 'percentage', + '0.00e+00' : 'float', + 'mm-dd-yy' : 'date', + 'd-mmm-yy' : 'date', + 'd-mmm' : 'date', + 'mmm-yy' : 'date', + 'h:mm am/pm' : 'date', + 'h:mm:ss am/pm' : 'date', + 'h:mm' : 'time', + 'h:mm:ss' : 'time', + 'm/d/yy h:mm' : 'date', + '#,##0 ;(#,##0)' : 'float', + '#,##0 ;[red](#,##0)' : 'float', + '#,##0.00;(#,##0.00)' : 'float', + '#,##0.00;[red](#,##0.00)' : 'float', + 'mm:ss' : 'time', + '[h]:mm:ss' : 'time', + 'mmss.0' : 'time', + '##0.0e+0' : 'float', + '@' : 'float', + 'yyyy\\-mm\\-dd' : 'date', + 'dd/mm/yy' : 'date', + 'hh:mm:ss' : 'time', + "dd/mm/yy\\ hh:mm" : 'date', + 'dd/mm/yyyy hh:mm:ss' : 'date', + 'yy-mm-dd' : 'date', + 'd-mmm-yyyy' : 'date', + 'm/d/yy' : 'date', + 'm/d/yyyy' : 'date', + 'dd-mmm-yyyy' : 'date', + 'dd/mm/yyyy' : 'date', + 'mm/dd/yy h:mm am/pm' : 'date', + 'mm/dd/yy hh:mm' : 'date', + 'mm/dd/yyyy h:mm am/pm' : 'date', + 'mm/dd/yyyy hh:mm:ss' : 'date', + 'yyyy-mm-dd hh:mm:ss' : 'date', + '#,##0;(#,##0)' : 'float', + '_(* #,##0_);_(* (#,##0);_(* "-"??_);_(@_)' : 'float', + '_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)' : 'float' +} +STANDARD_FORMATS = { + 0 : 'general', + 1 : '0', + 2 : '0.00', + 3 : '#,##0', + 4 : '#,##0.00', + 9 : '0%', + 10 : '0.00%', + 11 : '0.00e+00', + 12 : '# ?/?', + 13 : '# ??/??', + 14 : 'mm-dd-yy', + 15 : 'd-mmm-yy', + 16 : 'd-mmm', + 17 : 'mmm-yy', + 18 : 'h:mm am/pm', + 19 : 'h:mm:ss am/pm', + 20 : 'h:mm', + 21 : 'h:mm:ss', + 22 : 'm/d/yy h:mm', + 37 : '#,##0 ;(#,##0)', + 38 : '#,##0 ;[red](#,##0)', + 39 : '#,##0.00;(#,##0.00)', + 40 : '#,##0.00;[red](#,##0.00)', + 45 : 'mm:ss', + 46 : '[h]:mm:ss', + 47 : 'mmss.0', + 48 : '##0.0e+0', + 49 : '@', +} + +class XlsxException(Exception): + pass + +class InvalidXlsxFileException(XlsxException): + pass + +class SheetNotFoundException(XlsxException): + pass + +class OutFileAlreadyExistsException(XlsxException): + pass + +class Xlsx2csv: + """ + Usage: Xlsx2csv("test.xslx", **params).convert("test.csv", sheetid=1) + Input: + xlsxfile - path to file or filehandle + options: + sheetid - sheet no to convert (0 for all sheets) + dateformat - override date/time format + floatformat - override float format + delimiter - csv columns delimiter symbol + sheetdelimiter - sheets delimiter used when processing all sheets + skip_empty_lines - skip empty lines + skip_trailing_columns - skip trailing columns + hyperlinks - include hyperlinks + include_sheet_pattern - only include sheets named matching given pattern + exclude_sheet_pattern - exclude sheets named matching given pattern + """ + + def __init__(self, xlsxfile, **options): + options.setdefault("delimiter", ",") + options.setdefault("sheetdelimiter", "--------") + options.setdefault("dateformat", None) + options.setdefault("floatformat", None) + options.setdefault("skip_empty_lines", False) + options.setdefault("skip_trailing_columns", False) + options.setdefault("escape_strings", False) + options.setdefault("hyperlinks", False) + options.setdefault("include_sheet_pattern", ["^.*$"]) + options.setdefault("exclude_sheet_pattern", []) + options.setdefault("merge_cells", False) + options.setdefault("ignore_formats", ['']) + options.setdefault("lineterminator", "\n") + + self.options = options + try: + self.ziphandle = zipfile.ZipFile(xlsxfile) + except (zipfile.BadZipfile, IOError): + raise InvalidXlsxFileException("Invalid xlsx file: " + str(xlsxfile)) + + self.py3 = sys.version_info[0] == 3 + + self.shared_strings = self._parse(SharedStrings, "xl/sharedStrings.xml") + self.styles = self._parse(Styles, "xl/styles.xml") + self.workbook = self._parse(Workbook, "xl/workbook.xml") + self.workbook.relationships = self._parse(Relationships, "xl/_rels/workbook.xml.rels") + if self.options['escape_strings']: + self.shared_strings.escape_strings() + + def __del__(self): + # make sure to close zip file, ziphandler does have a close() method + self.ziphandle.close() + + def getSheetIdByName(self, name): + for s in self.workbook.sheets: + if s['name'] == name: + return s['id'] + return None + + def convert(self, outfile, sheetid=1): + """outfile - path to file or filehandle""" + if sheetid > 0: + self._convert(sheetid, outfile) + else: + if isinstance(outfile, str): + if not os.path.exists(outfile): + os.makedirs(outfile) + elif os.path.isfile(outfile): + raise OutFileAlreadyExistsException("File " + str(outfile) + " already exists!") + for s in self.workbook.sheets: + sheetname = s['name'] + + # filter sheets by include pattern + include_sheet_pattern = self.options['include_sheet_pattern'] + if type(include_sheet_pattern) == type(""): # optparser lib fix + include_sheet_pattern = [include_sheet_pattern] + if len(include_sheet_pattern) > 0: + include = False + for pattern in include_sheet_pattern: + include = pattern and len(pattern) > 0 and re.match(pattern, sheetname) + if include: + break + if not include: + continue + + # filter sheets by exclude pattern + exclude_sheet_pattern = self.options['exclude_sheet_pattern'] + if type(exclude_sheet_pattern) == type(""): # optparser lib fix + exclude_sheet_pattern = [exclude_sheet_pattern] + exclude = False + for pattern in exclude_sheet_pattern: + exclude = pattern and len(pattern) > 0 and re.match(pattern, sheetname) + if exclude: + break + if exclude: + continue + + if not self.py3: + sheetname = sheetname.encode('utf-8') + of = outfile + if isinstance(outfile, str): + of = os.path.join(outfile, sheetname + '.csv') + elif self.options['sheetdelimiter'] and len(self.options['sheetdelimiter']): + of.write(self.options['sheetdelimiter'] + " " + str(s['id']) + " - " + sheetname + self.options['lineterminator']) + self._convert(s['id'], of) + + def _convert(self, sheetid, outfile): + closefile = False + if isinstance(outfile, str): + if sys.version_info[0] == 2: + outfile = open(outfile, 'wb+') + elif sys.version_info[0] == 3: + outfile = open(outfile, 'w+', encoding=self.options['outputencoding'], newline="") + else: + sys.stderr.write("error: version of your python is not supported: " + str(sys.version_info) + "\n") + sys.exit(1) + closefile = True + try: + writer = csv.writer(outfile, quoting=csv.QUOTE_MINIMAL, delimiter=self.options['delimiter'], lineterminator=self.options['lineterminator']) + sheetfile = self._filehandle("xl/worksheets/sheet%i.xml" % sheetid) + if not sheetfile: + sheetfile = self._filehandle("xl/worksheets/worksheet%i.xml" % sheetid) + if not sheetfile and sheetid == 1: + sheetfile = self._filehandle("xl/worksheets/sheet.xml") + if not sheetfile and sheetid == 1: + sheetfile = self._filehandle("xl/worksheets/worksheet.xml") + if not sheetfile: + raise SheetNotFoundException("Sheet %s not found" %sheetid) + sheet = Sheet(self.workbook, self.shared_strings, self.styles, sheetfile) + try: + sheet.relationships = self._parse(Relationships, "xl/worksheets/_rels/sheet%i.xml.rels" % sheetid) + sheet.set_dateformat(self.options['dateformat']) + sheet.set_floatformat(self.options['floatformat']) + sheet.set_skip_empty_lines(self.options['skip_empty_lines']) + sheet.set_skip_trailing_columns(self.options['skip_trailing_columns']) + sheet.set_include_hyperlinks(self.options['hyperlinks']) + sheet.set_merge_cells(self.options['merge_cells']) + sheet.set_ignore_formats(self.options['ignore_formats']) + if self.options['escape_strings'] and sheet.filedata: + sheet.filedata = re.sub(r"([^<>]+) ([^<>]+)", r"\1\\n\2", re.sub(r"([^<>]+) ([^<>]+)", r"\1\\t\2", re.sub(r"([^<>]+) ([^<>]+)", r"\1\\r\2", sheet.filedata))) + sheet.to_csv(writer) + finally: + sheetfile.close() + sheet.close() + finally: + if closefile: + outfile.close() + + def _filehandle(self, filename): + for name in filter(lambda f: f.lower() == filename.lower(), self.ziphandle.namelist()): + # python2.4 fix + if not hasattr(self.ziphandle, "open"): + return StringIO(self.ziphandle.read(name)) + return self.ziphandle.open(name, "r") + return None + + def _parse(self, klass, filename): + instance = klass() + filehandle = self._filehandle(filename) + if filehandle: + instance.parse(filehandle) + filehandle.close() + return instance + +class Workbook: + def __init__(self): + self.sheets = [] + self.date1904 = False + + def parse(self, filehandle): + workbookDoc = minidom.parseString(filehandle.read()) + if workbookDoc.firstChild.namespaceURI: + fileVersion = workbookDoc.firstChild.getElementsByTagNameNS(workbookDoc.firstChild.namespaceURI, "fileVersion") + else: + fileVersion = workbookDoc.firstChild.getElementsByTagName("fileVersion") + if len(fileVersion) == 0: + self.appName = 'unknown' + else: + try: + if workbookDoc.firstChild.namespaceURI: + self.appName = workbookDoc.firstChild.getElementsByTagNameNS(workbookDoc.firstChild.namespaceURI, "fileVersion")[0]._attrs['appName'].value + else: + self.appName = workbookDoc.firstChild.getElementsByTagName("fileVersion")[0]._attrs['appName'].value + except KeyError: + # no app name + self.appName = 'unknown' + try: + if workbookDoc.firstChild.namespaceURI: + self.date1904 = workbookDoc.firstChild.getElementsByTagNameNS(workbookDoc.firstChild.namespaceURI, "workbookPr")[0]._attrs['date1904'].value.lower().strip() != "false" + else: + self.date1904 = workbookDoc.firstChild.getElementsByTagName("workbookPr")[0]._attrs['date1904'].value.lower().strip() != "false" + except: + pass + + if workbookDoc.firstChild.namespaceURI: + sheets = workbookDoc.firstChild.getElementsByTagNameNS(workbookDoc.firstChild.namespaceURI, "sheets")[0] + else: + sheets = workbookDoc.firstChild.getElementsByTagName("sheets")[0] + if workbookDoc.firstChild.namespaceURI: + sheetNodes = sheets.getElementsByTagNameNS(workbookDoc.firstChild.namespaceURI, "sheet") + else: + sheetNodes = sheets.getElementsByTagName("sheet") + for sheetNode in sheetNodes: + attrs = sheetNode._attrs + name = attrs["name"].value + if self.appName == 'xl' and len(attrs["r:id"].value) > 2: + if 'r:id' in attrs: id = int(attrs["r:id"].value[3:]) + else: id = int(attrs['sheetId'].value) + else: + if 'sheetId' in attrs: id = int(attrs["sheetId"].value) + else: id = int(attrs['r:id'].value[3:]) + self.sheets.append({'name': name, 'id': id}) + +class Relationships: + def __init__(self): + self.relationships = {} + + def parse(self, filehandle): + doc = minidom.parseString(filehandle.read()) + if doc.namespaceURI: + relationships = doc.getElementsByTagNameNS(doc.namespaceURI, "Relationships") + else: + relationships = doc.getElementsByTagName("Relationships") + if not relationships: + return + if doc.namespaceURI: + relationshipNodes = relationships[0].getElementsByTagNameNS(doc.namespaceURI, "Relationship") + else: + relationshipNodes = relationships[0].getElementsByTagName("Relationship") + for rel in relationshipNodes: + attrs = rel._attrs + rId = attrs.get('Id') + if rId: + vtype = attrs.get('Type') + target = attrs.get('Target') + self.relationships[str(rId.value)] = { + "type" : vtype and str(vtype.value) or None, + "target" : target and target.value.encode("utf-8") or None + } + +class Styles: + def __init__(self): + self.numFmts = {} + self.cellXfs = [] + + def parse(self, filehandle): + styles = minidom.parseString(filehandle.read()).firstChild + # numFmts + if styles.namespaceURI: + numFmtsElement = styles.getElementsByTagNameNS(styles.namespaceURI, "numFmts") + else: + numFmtsElement = styles.getElementsByTagName("numFmts") + if len(numFmtsElement) == 1: + for numFmt in numFmtsElement[0].childNodes: + if numFmt.nodeType == minidom.Node.ELEMENT_NODE: + numFmtId = int(numFmt._attrs['numFmtId'].value) + formatCode = numFmt._attrs['formatCode'].value.lower().replace('\\', '') + self.numFmts[numFmtId] = formatCode + # cellXfs + if styles.namespaceURI: + cellXfsElement = styles.getElementsByTagNameNS(styles.namespaceURI, "cellXfs") + else: + cellXfsElement = styles.getElementsByTagName("cellXfs") + if len(cellXfsElement) == 1: + for cellXfs in cellXfsElement[0].childNodes: + if cellXfs.nodeType != minidom.Node.ELEMENT_NODE or not (cellXfs.nodeName == "xf" or cellXfs.nodeName.endswith(":xf")): + continue + if 'numFmtId' in cellXfs._attrs: + numFmtId = int(cellXfs._attrs['numFmtId'].value) + self.cellXfs.append(numFmtId) + else: + self.cellXfs.append(None) + +class SharedStrings: + def __init__(self): + self.parser = None + self.strings = [] + self.si = False + self.t = False + self.rPh = False + self.value = "" + + def parse(self, filehandle): + self.parser = xml.parsers.expat.ParserCreate() + self.parser.CharacterDataHandler = self.handleCharData + self.parser.StartElementHandler = self.handleStartElement + self.parser.EndElementHandler = self.handleEndElement + self.parser.ParseFile(filehandle) + + def escape_strings(self): + for i in range(0, len(self.strings)): + self.strings[i] = self.strings[i].replace("\r", "\\r").replace("\n", "\\n").replace("\t", "\\t") + + def handleCharData(self, data): + if self.t: + self.value+= data + + def handleStartElement(self, name, attrs): + # ignore namespace + i = name.find(":") + if i >= 0: + name = name[i + 1:] + + if name == 'si': + self.si = True + self.value = "" + elif name == 't' and self.rPh: + self.t = False + elif name == 't' and self.si: + self.t = True + elif name == 'rPh': + self.rPh = True + + def handleEndElement(self, name): + # ignore namespace + i = name.find(":") + if i >= 0: + name = name[i + 1:] + + if name == 'si': + self.si = False + self.strings.append(self.value) + elif name == 't': + self.t = False + elif name == 'rPh': + self.rPh = False + +class Sheet: + def __init__(self, workbook, sharedString, styles, filehandle): + self.py3 = sys.version_info[0] == 3 + self.parser = None + self.writer = None + self.sharedString = None + self.styles = None + self.relationships = None + self.columns_count = -1 + + self.in_sheet = False + self.in_row = False + self.in_cell = False + self.in_cell_value = False + + self.columns = {} + self.lastRowNum = 0 + self.rowNum = None + self.colType = None + self.cellId = None + self.s_attr = None + self.data = None + self.max_columns = -1 + + self.dateformat = None + self.floatformat = None + self.skip_empty_lines = False + self.skip_trailing_columns = False + + self.filedata = None + self.filehandle = filehandle + self.workbook = workbook + self.sharedStrings = sharedString.strings + self.styles = styles + + self.hyperlinks = {} + self.mergeCells = {} + self.ignore_formats = [] + + def close(self): + # Make sure Worksheet is closed, parsers lib does not have a close() function, so simply delete it + self.parser = None + + def set_dateformat(self, dateformat): + self.dateformat = dateformat + + def set_floatformat(self, floatformat): + self.floatformat = floatformat + + def set_skip_empty_lines(self, skip): + self.skip_empty_lines = skip + + def set_skip_trailing_columns(self, skip): + self.skip_trailing_columns = skip + + def set_ignore_formats(self, ignore_formats): + self.ignore_formats = ignore_formats + + def set_merge_cells(self, mergecells): + if not mergecells: + return + if not self.filedata: + self.filedata = self.filehandle.read() + data = str(self.filedata) # python3: convert byte buffer to string + + # find worksheet tag, we need namespaces from it + start = data.find("", start) + worksheet = data[start : end + 1] + + # find hyperlinks part + start = data.find("") + data = data[start : end + 13] + + # parse hyperlinks + doc = minidom.parseString(worksheet + data + "").firstChild + + if doc.namespaceURI: + mergeCells = doc.getElementsByTagNameNS(doc.namespaceURI, "mergeCell") + else: + mergeCells = doc.getElementsByTagName("mergeCell") + for mergeCell in mergeCells: + attrs = mergeCell._attrs + if 'ref' in attrs.keys(): + rangeStr = attrs['ref'].value + rng = rangeStr.split(":") + if len(rng) > 1: + for cell in self._range(rangeStr): + self.mergeCells[cell] = {} + self.mergeCells[cell]['copyFrom'] = rng[0] + + def set_include_hyperlinks(self, hyperlinks): + if not hyperlinks or not self.relationships or not self.relationships.relationships: + return + # we must read file first to get hyperlinks, but we don't wont to parse whole file + if not self.filedata: + self.filedata = self.filehandle.read() + data = str(self.filedata) # python3: convert byte buffer to string + + # find worksheet tag, we need namespaces from it + start = data.find("", start) + worksheet = data[start : end + 1] + + # find hyperlinks part + start = data.find("") + if start < 0: + # hyperlinks not found + return + end = data.find("") + data = data[start : end + 13] + + # parse hyperlinks + doc = minidom.parseString(worksheet + data + "").firstChild + if doc.namespaceURI: + hiperlinkNodes = doc.getElementsByTagNameNS(doc.namespaceURI, "hyperlink") + else: + hiperlinkNodes = doc.getElementsByTagName("hyperlink") + for hlink in hiperlinkNodes: + attrs = hlink._attrs + ref = rId = None + for k in attrs.keys(): + if k == "ref": + ref = str(attrs[k].value) + if k.endswith(":id"): + rId = str(attrs[k].value) + if not ref or not rId: + continue + rel = self.relationships.relationships.get(rId) + if not rel: + continue + target = rel.get('target') + for cell in self._range(ref): + self.hyperlinks[cell] = target + + def to_csv(self, writer): + self.writer = writer + self.parser = xml.parsers.expat.ParserCreate() + self.parser.CharacterDataHandler = self.handleCharData + self.parser.StartElementHandler = self.handleStartElement + self.parser.EndElementHandler = self.handleEndElement + if self.filedata: + self.parser.Parse(self.filedata) + else: + self.parser.ParseFile(self.filehandle) + + def handleCharData(self, data): + if self.in_cell_value: + self.collected_string+= data + self.data = self.collected_string + if self.colType == "s": # shared string + self.data = self.sharedStrings[int(self.data)] + elif self.colType == "b": # boolean + self.data = (int(data) == 1 and "TRUE") or (int(data) == 0 and "FALSE") or data + elif self.s_attr: + s = int(self.s_attr) + + # get cell format + format_str = None + xfs_numfmt = self.styles.cellXfs[s] + if xfs_numfmt in self.styles.numFmts: + format_str = self.styles.numFmts[xfs_numfmt] + elif xfs_numfmt in STANDARD_FORMATS: + format_str = STANDARD_FORMATS[xfs_numfmt] + # get format type + if not format_str: + print("unknown format %s at %d" %(format_str,xfs_numfmt)) + return + format_type = None + if format_str in FORMATS: + format_type = FORMATS[format_str] + elif re.match("^\d+(\.\d+)?$", self.data) and re.match(".*[hsmdyY]", format_str) and not re.match('.*\[.*[dmhys].*\]', format_str): + # it must be date format + if float(self.data) < 1: + format_type = "time" + else: + format_type = "date" + elif re.match("^-?\d+(.\d+)?$", self.data): + format_type = "float" + if format_type == 'date' and self.dateformat == 'float' : + format_type = "float" + if format_type and not format_type in self.ignore_formats : + try: + if format_type == 'date': # date/time + if self.workbook.date1904: + date = datetime.datetime(1904, 1, 1) + datetime.timedelta(float(self.data)) + else: + date = datetime.datetime(1899, 12, 30) + datetime.timedelta(float(self.data)) + if self.dateformat: + # str(dateformat) - python2.5 bug, see: http://bugs.python.org/issue2782 + self.data = date.strftime(str(self.dateformat)) + else: + # ignore ";@", don't know what does it mean right now + # ignore "[$-409]" and similar format codes + dateformat = re.sub(r"\[\$\-\d{1,3}\]", "", format_str, 1). \ + replace(";@", ""). \ + replace("yyyy", "%Y").replace("yy", "%y"). \ + replace("hh:mm", "%H:%M").replace("h", "%I").replace("%H%H", "%H").replace("ss", "%S"). \ + replace("dd", "d").replace("d", "%d"). \ + replace("am/pm", "%p"). \ + replace("mmmm", "%B").replace("mmm", "%b").replace(":mm", ":%M").replace("m", "%m").replace("%m%m", "%m") + self.data = date.strftime(str(dateformat)).strip() + elif format_type == 'time': # time + t = int(round((float(self.data)%1) * 24*60*60, 6)) / 60 # round to microseconds + self.data = "%.2i:%.2i" %(t / 60, t % 60) #str(t / 60) + ":" + ('0' + str(t % 60))[-2:] + elif format_type == 'float' and ('E' in self.data or 'e' in self.data): + self.data = ("%f" %(float(self.data))).rstrip('0').rstrip('.') + elif format_type == 'float' and format_str[0:3] == '0.0': + if self.floatformat: + self.data = str(self.floatformat) % float(self.data) + else: + L = len(format_str.split(".")[1]) + if '%' in format_str: + L += 1 + self.data = ("%." + str(L) + "f") % float(self.data) + + except (ValueError, OverflowError): + # invalid date format + pass + + def handleStartElement(self, name, attrs): + has_namespace = name.find(":") > 0 + if self.in_row and (name == 'c' or (has_namespace and name.endswith(':c'))): + self.colType = attrs.get("t") + self.s_attr = attrs.get("s") + self.cellId = attrs.get("r") + if self.cellId: + self.colNum = self.cellId[:len(self.cellId)-len(self.rowNum)] + self.colIndex = 0 + else: + self.colIndex+= 1 + self.data = "" + self.in_cell = True + elif self.in_cell and ((name == 'v' or name == 'is') or (has_namespace and (name.endswith(':v') or name.endswith(':is')))): + self.in_cell_value = True + self.collected_string = "" + elif self.in_sheet and (name == 'row' or (has_namespace and name.endswith(':row'))) and ('r' in attrs): + self.rowNum = attrs['r'] + self.in_row = True + self.columns = {} + self.spans = None + if 'spans' in attrs: + self.spans = [int(i) for i in attrs['spans'].split(":")] + + elif name == 'sheetData' or (has_namespace and name.endswith(':sheetData')): + self.in_sheet = True + elif name == 'dimension': + rng = attrs.get("ref").split(":") + if len(rng) > 1: + start = re.match("^([A-Z]+)(\d+)$", rng[0]) + if (start): + end = re.match("^([A-Z]+)(\d+)$", rng[1]) + startCol = start.group(1) + endCol = end.group(1) + self.columns_count = 0 + for cell in self._range(startCol + "1:" + endCol + "1"): + self.columns_count+= 1 + + def handleEndElement(self, name): + has_namespace = name.find(":") > 0 + if self.in_cell and name == 'v': + self.in_cell_value = False + elif self.in_cell and (name == 'c' or (has_namespace and name.endswith(':c'))): + t = 0 + for i in self.colNum: t = t*26 + ord(i) - 64 + d = self.data + if self.hyperlinks: + hyperlink = self.hyperlinks.get(self.cellId) + if hyperlink: + if self.py3: + hyperlink = hyperlink.decode("utf-8") + d = "" + d + "" + if self.colNum + self.rowNum in self.mergeCells.keys(): + if 'copyFrom' in self.mergeCells[self.colNum + self.rowNum].keys() and self.mergeCells[self.colNum + self.rowNum]['copyFrom'] == self.colNum + self.rowNum: + self.mergeCells[self.colNum + self.rowNum]['value'] = d + else: + d = self.mergeCells[self.mergeCells[self.colNum + self.rowNum]['copyFrom']]['value'] + + self.columns[t - 1 + self.colIndex] = d + + if self.in_row and (name == 'row' or (has_namespace and name.endswith(':row'))): + if len(self.columns.keys()) > 0: + d = [""] * (max(self.columns.keys()) + 1) + for k in self.columns.keys(): + val = self.columns[k] + if not self.py3: + val = val.encode("utf-8") + d[k] = val + if self.spans: + l = self.spans[0] + self.spans[1] - 1 + if len(d) < l: + d+= (l - len(d)) * [''] + + # write empty lines + if not self.skip_empty_lines: + for i in range(self.lastRowNum, int(self.rowNum) - 1): + self.writer.writerow([]) + self.lastRowNum = int(self.rowNum) + + # write line to csv + if not self.skip_empty_lines or d.count('') != len(d): + while len(d) < self.columns_count: + d.append("") + + if self.skip_trailing_columns: + if self.max_columns < 0: + self.max_columns = len(d) + while len(d) > 0 and d[-1] == "": + d = d[0:-1] + self.max_columns = self.max_columns - 1 + elif self.max_columns > 0: + d = d[0:self.max_columns] + self.writer.writerow(d) + + self.in_row = False + elif self.in_sheet and (name == 'sheetData' or (has_namespace and name.endswith(':sheetData'))): + self.in_sheet = False + + # rangeStr: "A3:C12" or "D5" + # example: for cell in _range("A1:Z12"): print cell + def _range(self, rangeStr): + rng = rangeStr.split(":") + if len(rng) == 1: + yield rangeStr + else: + start = re.match("^([A-Z]+)(\d+)$", rng[0]) + end = re.match("^([A-Z]+)(\d+)$", rng[1]) + if not start or not end: + return + startCol = start.group(1) + startRow = int(start.group(2)) + endCol = end.group(1) + endRow = int(end.group(2)) + col = startCol + while True: + for row in range(startRow, endRow + 1): + yield col + str(row) + if col == endCol: + break + t = 0 + for i in col: t = t * 26 + ord(i) - 64 + col = "" + while t >= 0: + col = chr(t % 26 + 65) + col + t = t // 26 - 1 + + +def convert_recursive(path, sheetid, outfile, kwargs): + for name in os.listdir(path): + fullpath = os.path.join(path, name) + if os.path.isdir(fullpath): + convert_recursive(fullpath, sheetid, outfile, kwargs) + else: + outfilepath = outfile + if len(outfilepath) == 0 and fullpath.lower().endswith(".xlsx"): + outfilepath = fullpath[:-4] + 'csv' + + print("Converting %s to %s" %(fullpath, outfilepath)) + try: + Xlsx2csv(fullpath, **kwargs).convert(outfilepath, sheetid) + except zipfile.BadZipfile: + print("File %s is not a zip file" %fullpath) + +if __name__ == "__main__": + try: + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + signal.signal(signal.SIGINT, signal.SIG_DFL) + except AttributeError: + pass + + if "ArgumentParser" in globals(): + parser = ArgumentParser(description = "xlsx to csv converter") + parser.add_argument('infile', metavar='xlsxfile', help="xlsx file path") + parser.add_argument('outfile', metavar='outfile', nargs='?', help="output csv file path") + parser.add_argument('-v', '--version', action='version', version=__version__) + nargs_plus = "+" + argparser = True + else: + parser = OptionParser(usage = "%prog [options] infile [outfile]", version=__version__) + parser.add_argument = parser.add_option + nargs_plus = 1 + argparser = False + + + if sys.version_info[0] == 2 and sys.version_info[1] < 5: + inttype = "int" + else: + inttype = int + parser.add_argument("-a", "--all", dest="all", default=False, action="store_true", + help="export all sheets") + parser.add_argument("-c", "--outputencoding", dest="outputencoding", default="utf-8", action="store", + help="encoding of output csv ** Python 3 only ** (default: utf-8)") + parser.add_argument("-d", "--delimiter", dest="delimiter", default=",", + help="delimiter - columns delimiter in csv, 'tab' or 'x09' for a tab (default: comma ',')") + parser.add_argument("--hyperlinks", "--hyperlinks", dest="hyperlinks", action="store_true", default=False, + help="include hyperlinks") + parser.add_argument("-e", "--escape", dest='escape_strings', default=False, action="store_true", + help="Escape \\r\\n\\t characters") + parser.add_argument("-E", "--exclude_sheet_pattern", nargs=nargs_plus, dest="exclude_sheet_pattern", default="", + help="exclude sheets named matching given pattern, only effects when -a option is enabled.") + parser.add_argument("-f", "--dateformat", dest="dateformat", + help="override date/time format (ex. %%Y/%%m/%%d)") + parser.add_argument("--floatformat", dest="floatformat", + help="override float format (ex. %%.15f") + parser.add_argument("-I", "--include_sheet_pattern", nargs=nargs_plus, dest="include_sheet_pattern", default="^.*$", + help="only include sheets named matching given pattern, only effects when -a option is enabled.") + parser.add_argument("-if", "--ignore-formats", nargs=nargs_plus, type=str, dest="ignore_formats", default=[''], + help="Ignores format for specific data types.") + parser.add_argument("-l", "--lineterminator", dest="lineterminator", default="\n", + help="line terminator - lines terminator in csv, '\\n' '\\r\\n' or '\\r' (default: \\n)") + parser.add_argument("-m", "--merge-cells", dest="merge_cells", default=False, action="store_true", + help="merge cells") + parser.add_argument("-n", "--sheetname", dest="sheetname", default=None, + help="sheet name to convert") + parser.add_argument("-i", "--ignoreempty", dest="skip_empty_lines", default=False, action="store_true", + help="skip empty lines") + parser.add_argument("--skipemptycolumns", dest="skip_trailing_columns", default=False, action="store_false", + help="skip trailing empty columns") + parser.add_argument("-p", "--sheetdelimiter", dest="sheetdelimiter", default="--------", + help="sheet delimiter used to separate sheets, pass '' if you do not need delimiter, or 'x07' or '\\f' for form feed (default: '--------')") + parser.add_argument("-s", "--sheet", dest="sheetid", default=1, type=inttype, + help="sheet number to convert") + + if argparser: + options = parser.parse_args() + else: + (options, args) = parser.parse_args() + if len(args) < 1: + parser.print_usage() + sys.stderr.write("error: too few arguments" + os.linesep) + sys.exit(1) + options.infile = args[0] + options.outfile = len(args) > 1 and args[1] or None + + if len(options.delimiter) == 1: + pass + elif options.delimiter == 'tab' or '\\t': + options.delimiter = '\t' + elif options.delimiter == 'comma': + options.delimiter = ',' + elif options.delimiter[0] == 'x': + options.delimiter = chr(int(options.delimiter[1:])) + else: + sys.stderr.write("error: invalid delimiter\n") + sys.exit(1) + + if options.lineterminator == '\n': + pass + elif options.lineterminator == '\\n': + options.lineterminator = '\n' + elif options.lineterminator == '\\r': + options.lineterminator = '\r' + elif options.lineterminator == '\\r\\n': + options.lineterminator = '\r\n' + else: + sys.stderr.write("error: invalid line terminator\n") + sys.exit(1) + + if options.sheetdelimiter == '--------': + pass + elif options.sheetdelimiter == '\\f': + options.sheetdelimiter = '\f' + elif options.sheetdelimiter[0] == 'x': + options.sheetdelimiter = chr(int(options.sheetdelimiter[1:])) + else: + sys.stderr.write("error: invalid sheet delimiter\n") + sys.exit(1) + + kwargs = { + 'delimiter' : options.delimiter, + 'sheetdelimiter' : options.sheetdelimiter, + 'dateformat' : options.dateformat, + 'floatformat' : options.floatformat, + 'skip_empty_lines' : options.skip_empty_lines, + 'skip_trailing_columns' : options.skip_trailing_columns, + 'escape_strings' : options.escape_strings, + 'hyperlinks' : options.hyperlinks, + 'include_sheet_pattern' : options.include_sheet_pattern, + 'exclude_sheet_pattern' : options.exclude_sheet_pattern, + 'merge_cells' : options.merge_cells, + 'outputencoding' : options.outputencoding, + 'lineterminator' : options.lineterminator, + 'ignore_formats' : options.ignore_formats + } + sheetid = options.sheetid + if options.all: + sheetid = 0 + + outfile = options.outfile or sys.stdout + try: + if os.path.isdir(options.infile): + convert_recursive(options.infile, sheetid, outfile, kwargs) + else: + xlsx2csv = Xlsx2csv(options.infile, **kwargs) + if options.sheetname: + sheetid = xlsx2csv.getSheetIdByName(options.sheetname) + if not sheetid: + raise XlsxException("Sheet '%s' not found" % options.sheetname) + xlsx2csv.convert(outfile, sheetid) + except XlsxException: + _, e, _ = sys.exc_info() + sys.stderr.write(str(e) + "\n") + sys.exit(1) diff --git a/setup/SE/include/python2.7 b/setup/SE/include/python2.7 new file mode 120000 index 0000000..ad4ca80 --- /dev/null +++ b/setup/SE/include/python2.7 @@ -0,0 +1 @@ +/usr/include/python2.7 \ No newline at end of file diff --git a/setup/SE/local/bin b/setup/SE/local/bin new file mode 120000 index 0000000..197b729 --- /dev/null +++ b/setup/SE/local/bin @@ -0,0 +1 @@ +/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/bin \ No newline at end of file diff --git a/setup/SE/local/include b/setup/SE/local/include new file mode 120000 index 0000000..9e27f4a --- /dev/null +++ b/setup/SE/local/include @@ -0,0 +1 @@ +/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/include \ No newline at end of file diff --git a/setup/SE/local/lib b/setup/SE/local/lib new file mode 120000 index 0000000..9e83984 --- /dev/null +++ b/setup/SE/local/lib @@ -0,0 +1 @@ +/poseidon6/p6tools/aws-gits/Tools/SimplyEmail/setup/SE/lib \ No newline at end of file diff --git a/setup/SE/man/man1/nosetests.1 b/setup/SE/man/man1/nosetests.1 new file mode 100644 index 0000000..5772845 --- /dev/null +++ b/setup/SE/man/man1/nosetests.1 @@ -0,0 +1,581 @@ +.\" Man page generated from reStructuredText. +. +.TH "NOSETESTS" "1" "April 04, 2015" "1.3" "nose" +.SH NAME +nosetests \- Nicer testing for Python +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH NICER TESTING FOR PYTHON +.SS SYNOPSIS +.INDENT 0.0 +.INDENT 3.5 +nosetests [options] [names] +.UNINDENT +.UNINDENT +.SS DESCRIPTION +.sp +nose collects tests automatically from python source files, +directories and packages found in its working directory (which +defaults to the current working directory). Any python source file, +directory or package that matches the testMatch regular expression +(by default: \fI(?:^|[b_.\-])[Tt]est)\fP will be collected as a test (or +source for collection of tests). In addition, all other packages +found in the working directory will be examined for python source files +or directories that match testMatch. Package discovery descends all +the way down the tree, so package.tests and package.sub.tests and +package.sub.sub2.tests will all be collected. +.sp +Within a test directory or package, any python source file matching +testMatch will be examined for test cases. Within a test module, +functions and classes whose names match testMatch and TestCase +subclasses with any name will be loaded and executed as tests. Tests +may use the assert keyword or raise AssertionErrors to indicate test +failure. TestCase subclasses may do the same or use the various +TestCase methods available. +.sp +\fBIt is important to note that the default behavior of nose is to +not include tests from files which are executable.\fP To include +tests from such files, remove their executable bit or use +the \-\-exe flag (see \(aqOptions\(aq section below). +.SS Selecting Tests +.sp +To specify which tests to run, pass test names on the command line: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +nosetests only_test_this.py +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Test names specified may be file or module names, and may optionally +indicate the test case to run by separating the module or file name +from the test case name with a colon. Filenames may be relative or +absolute. Examples: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +nosetests test.module +nosetests another.test:TestCase.test_method +nosetests a.test:TestCase +nosetests /path/to/test/file.py:test_function +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +You may also change the working directory where nose looks for tests +by using the \-w switch: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +nosetests \-w /path/to/tests +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Note, however, that support for multiple \-w arguments is now deprecated +and will be removed in a future release. As of nose 0.10, you can get +the same behavior by specifying the target directories \fIwithout\fP +the \-w switch: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +nosetests /path/to/tests /another/path/to/tests +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Further customization of test selection and loading is possible +through the use of plugins. +.sp +Test result output is identical to that of unittest, except for +the additional features (error classes, and plugin\-supplied +features such as output capture and assert introspection) detailed +in the options below. +.SS Configuration +.sp +In addition to passing command\-line options, you may also put +configuration options in your project\(aqs \fIsetup.cfg\fP file, or a .noserc +or nose.cfg file in your home directory. In any of these standard +ini\-style config files, you put your nosetests configuration in a +\fB[nosetests]\fP section. Options are the same as on the command line, +with the \-\- prefix removed. For options that are simple switches, you +must supply a value: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[nosetests] +verbosity=3 +with\-doctest=1 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +All configuration files that are found will be loaded and their +options combined. You can override the standard config file loading +with the \fB\-c\fP option. +.SS Using Plugins +.sp +There are numerous nose plugins available via easy_install and +elsewhere. To use a plugin, just install it. The plugin will add +command line options to nosetests. To verify that the plugin is installed, +run: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +nosetests \-\-plugins +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +You can add \-v or \-vv to that command to show more information +about each plugin. +.sp +If you are running nose.main() or nose.run() from a script, you +can specify a list of plugins to use by passing a list of plugins +with the plugins keyword argument. +.SS 0.9 plugins +.sp +nose 1.0 can use SOME plugins that were written for nose 0.9. The +default plugin manager inserts a compatibility wrapper around 0.9 +plugins that adapts the changed plugin api calls. However, plugins +that access nose internals are likely to fail, especially if they +attempt to access test case or test suite classes. For example, +plugins that try to determine if a test passed to startTest is an +individual test or a suite will fail, partly because suites are no +longer passed to startTest and partly because it\(aqs likely that the +plugin is trying to find out if the test is an instance of a class +that no longer exists. +.SS 0.10 and 0.11 plugins +.sp +All plugins written for nose 0.10 and 0.11 should work with nose 1.0. +.SS Options +.INDENT 0.0 +.TP +.B \-V, \-\-version +Output nose version and exit +.UNINDENT +.INDENT 0.0 +.TP +.B \-p, \-\-plugins +Output list of available plugins and exit. Combine with higher verbosity for greater detail +.UNINDENT +.INDENT 0.0 +.TP +.B \-v=DEFAULT, \-\-verbose=DEFAULT +Be more verbose. [NOSE_VERBOSE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-verbosity=VERBOSITY +Set verbosity; \-\-verbosity=2 is the same as \-v +.UNINDENT +.INDENT 0.0 +.TP +.B \-q=DEFAULT, \-\-quiet=DEFAULT +Be less verbose +.UNINDENT +.INDENT 0.0 +.TP +.B \-c=FILES, \-\-config=FILES +Load configuration from config file(s). May be specified multiple times; in that case, all config files will be loaded and combined +.UNINDENT +.INDENT 0.0 +.TP +.B \-w=WHERE, \-\-where=WHERE +Look for tests in this directory. May be specified multiple times. The first directory passed will be used as the working directory, in place of the current working directory, which is the default. Others will be added to the list of tests to execute. [NOSE_WHERE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-py3where=PY3WHERE +Look for tests in this directory under Python 3.x. Functions the same as \(aqwhere\(aq, but only applies if running under Python 3.x or above. Note that, if present under 3.x, this option completely replaces any directories specified with \(aqwhere\(aq, so the \(aqwhere\(aq option becomes ineffective. [NOSE_PY3WHERE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-m=REGEX, \-\-match=REGEX, \-\-testmatch=REGEX +Files, directories, function names, and class names that match this regular expression are considered tests. Default: (?:^|[b_./\-])[Tt]est [NOSE_TESTMATCH] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-tests=NAMES +Run these tests (comma\-separated list). This argument is useful mainly from configuration files; on the command line, just pass the tests to run as additional arguments with no switch. +.UNINDENT +.INDENT 0.0 +.TP +.B \-l=DEFAULT, \-\-debug=DEFAULT +Activate debug logging for one or more systems. Available debug loggers: nose, nose.importer, nose.inspector, nose.plugins, nose.result and nose.selector. Separate multiple names with a comma. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-debug\-log=FILE +Log debug messages to this file (default: sys.stderr) +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-logging\-config=FILE, \-\-log\-config=FILE +Load logging config from this file \-\- bypasses all other logging config settings. +.UNINDENT +.INDENT 0.0 +.TP +.B \-I=REGEX, \-\-ignore\-files=REGEX +Completely ignore any file that matches this regular expression. Takes precedence over any other settings or plugins. Specifying this option will replace the default setting. Specify this option multiple times to add more regular expressions [NOSE_IGNORE_FILES] +.UNINDENT +.INDENT 0.0 +.TP +.B \-e=REGEX, \-\-exclude=REGEX +Don\(aqt run tests that match regular expression [NOSE_EXCLUDE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-i=REGEX, \-\-include=REGEX +This regular expression will be applied to files, directories, function names, and class names for a chance to include additional tests that do not match TESTMATCH. Specify this option multiple times to add more regular expressions [NOSE_INCLUDE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-x, \-\-stop +Stop running tests after the first error or failure +.UNINDENT +.INDENT 0.0 +.TP +.B \-P, \-\-no\-path\-adjustment +Don\(aqt make any changes to sys.path when loading tests [NOSE_NOPATH] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-exe +Look for tests in python modules that are executable. Normal behavior is to exclude executable modules, since they may not be import\-safe [NOSE_INCLUDE_EXE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-noexe +DO NOT look for tests in python modules that are executable. (The default on the windows platform is to do so.) +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-traverse\-namespace +Traverse through all path entries of a namespace package +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-first\-package\-wins, \-\-first\-pkg\-wins, \-\-1st\-pkg\-wins +nose\(aqs importer will normally evict a package from sys.modules if it sees a package with the same name in a different location. Set this option to disable that behavior. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-byte\-compile +Prevent nose from byte\-compiling the source into .pyc files while nose is scanning for and running tests. +.UNINDENT +.INDENT 0.0 +.TP +.B \-a=ATTR, \-\-attr=ATTR +Run only tests that have attributes specified by ATTR [NOSE_ATTR] +.UNINDENT +.INDENT 0.0 +.TP +.B \-A=EXPR, \-\-eval\-attr=EXPR +Run only tests for whose attributes the Python expression EXPR evaluates to True [NOSE_EVAL_ATTR] +.UNINDENT +.INDENT 0.0 +.TP +.B \-s, \-\-nocapture +Don\(aqt capture stdout (any stdout output will be printed immediately) [NOSE_NOCAPTURE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-nologcapture +Disable logging capture plugin. Logging configuration will be left intact. [NOSE_NOLOGCAPTURE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-logging\-format=FORMAT +Specify custom format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGFORMAT] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-logging\-datefmt=FORMAT +Specify custom date/time format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGDATEFMT] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-logging\-filter=FILTER +Specify which statements to filter in/out. By default, everything is captured. If the output is too verbose, +use this option to filter out needless output. +Example: filter=foo will capture statements issued ONLY to + foo or foo.what.ever.sub but not foobar or other logger. +Specify multiple loggers with comma: filter=foo,bar,baz. +If any logger name is prefixed with a minus, eg filter=\-foo, +it will be excluded rather than included. Default: exclude logging messages from nose itself (\-nose). [NOSE_LOGFILTER] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-logging\-clear\-handlers +Clear all other logging handlers +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-logging\-level=DEFAULT +Set the log level to capture +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-with\-coverage +Enable plugin Coverage: +Activate a coverage report using Ned Batchelder\(aqs coverage module. + [NOSE_WITH_COVERAGE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-package=PACKAGE +Restrict coverage output to selected packages [NOSE_COVER_PACKAGE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-erase +Erase previously collected coverage statistics before run +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-tests +Include test modules in coverage report [NOSE_COVER_TESTS] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-min\-percentage=DEFAULT +Minimum percentage of coverage for tests to pass [NOSE_COVER_MIN_PERCENTAGE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-inclusive +Include all python files under working directory in coverage report. Useful for discovering holes in test coverage if not all files are imported by the test suite. [NOSE_COVER_INCLUSIVE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-html +Produce HTML coverage information +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-html\-dir=DIR +Produce HTML coverage information in dir +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-branches +Include branch coverage in coverage report [NOSE_COVER_BRANCHES] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-xml +Produce XML coverage information +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cover\-xml\-file=FILE +Produce XML coverage information in file +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pdb +Drop into debugger on failures or errors +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pdb\-failures +Drop into debugger on failures +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pdb\-errors +Drop into debugger on errors +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-deprecated +Disable special handling of DeprecatedTest exceptions. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-with\-doctest +Enable plugin Doctest: +Activate doctest plugin to find and run doctests in non\-test modules. + [NOSE_WITH_DOCTEST] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-doctest\-tests +Also look for doctests in test modules. Note that classes, methods and functions should have either doctests or non\-doctest tests, not both. [NOSE_DOCTEST_TESTS] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-doctest\-extension=EXT +Also look for doctests in files with this extension [NOSE_DOCTEST_EXTENSION] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-doctest\-result\-variable=VAR +Change the variable name set to the result of the last interpreter command from the default \(aq_\(aq. Can be used to avoid conflicts with the _() function used for text translation. [NOSE_DOCTEST_RESULT_VAR] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-doctest\-fixtures=SUFFIX +Find fixtures for a doctest file in module with this name appended to the base name of the doctest file +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-doctest\-options=OPTIONS +Specify options to pass to doctest. Eg. \(aq+ELLIPSIS,+NORMALIZE_WHITESPACE\(aq +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-with\-isolation +Enable plugin IsolationPlugin: +Activate the isolation plugin to isolate changes to external +modules to a single test module or package. The isolation plugin +resets the contents of sys.modules after each test module or +package runs to its state before the test. PLEASE NOTE that this +plugin should not be used with the coverage plugin, or in any other case +where module reloading may produce undesirable side\-effects. + [NOSE_WITH_ISOLATION] +.UNINDENT +.INDENT 0.0 +.TP +.B \-d, \-\-detailed\-errors, \-\-failure\-detail +Add detail to error output by attempting to evaluate failed asserts [NOSE_DETAILED_ERRORS] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-with\-profile +Enable plugin Profile: +Use this plugin to run tests using the hotshot profiler. + [NOSE_WITH_PROFILE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-profile\-sort=SORT +Set sort order for profiler output +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-profile\-stats\-file=FILE +Profiler stats file; default is a new temp file on each run +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-profile\-restrict=RESTRICT +Restrict profiler output. See help for pstats.Stats for details +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-skip +Disable special handling of SkipTest exceptions. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-with\-id +Enable plugin TestId: +Activate to add a test id (like #1) to each test name output. Activate +with \-\-failed to rerun failing tests only. + [NOSE_WITH_ID] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-id\-file=FILE +Store test ids found in test runs in this file. Default is the file .noseids in the working directory. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-failed +Run the tests that failed in the last test run. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-processes=NUM +Spread test run among this many processes. Set a number equal to the number of processors or cores in your machine for best results. Pass a negative number to have the number of processes automatically set to the number of cores. Passing 0 means to disable parallel testing. Default is 0 unless NOSE_PROCESSES is set. [NOSE_PROCESSES] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-process\-timeout=SECONDS +Set timeout for return of results from each test runner process. Default is 10. [NOSE_PROCESS_TIMEOUT] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-process\-restartworker +If set, will restart each worker process once their tests are done, this helps control memory leaks from killing the system. [NOSE_PROCESS_RESTARTWORKER] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-with\-xunit +Enable plugin Xunit: This plugin provides test results in the standard XUnit XML format. [NOSE_WITH_XUNIT] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-xunit\-file=FILE +Path to xml file to store the xunit report in. Default is nosetests.xml in the working directory [NOSE_XUNIT_FILE] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-xunit\-testsuite\-name=PACKAGE +Name of the testsuite in the xunit xml, generated by plugin. Default test suite name is nosetests. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-modules +Enable plugin AllModules: Collect tests from all python modules. + [NOSE_ALL_MODULES] +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-collect\-only +Enable collect\-only: +Collect and output test names only, don\(aqt run any tests. + [COLLECT_ONLY] +.UNINDENT +.SH AUTHOR +Nose developers +.SH COPYRIGHT +2009, Jason Pellerin +.\" Generated by docutils manpage writer. +. diff --git a/setup/SE/pip-selfcheck.json b/setup/SE/pip-selfcheck.json new file mode 100644 index 0000000..340fb06 --- /dev/null +++ b/setup/SE/pip-selfcheck.json @@ -0,0 +1 @@ +{"last_check":"2018-06-23T20:04:12Z","pypi_version":"10.0.1"} \ No newline at end of file diff --git a/setup/SE/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl b/setup/SE/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl new file mode 100644 index 0000000..53c26de Binary files /dev/null and b/setup/SE/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl b/setup/SE/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl new file mode 100644 index 0000000..13f637f Binary files /dev/null and b/setup/SE/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl b/setup/SE/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl new file mode 100644 index 0000000..a74e50b Binary files /dev/null and b/setup/SE/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl b/setup/SE/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl new file mode 100644 index 0000000..1143fac Binary files /dev/null and b/setup/SE/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl b/setup/SE/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl new file mode 100644 index 0000000..9e1a0df Binary files /dev/null and b/setup/SE/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/distlib-0.2.7-py2.py3-none-any.whl b/setup/SE/share/python-wheels/distlib-0.2.7-py2.py3-none-any.whl new file mode 100644 index 0000000..b1fb8a8 Binary files /dev/null and b/setup/SE/share/python-wheels/distlib-0.2.7-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl b/setup/SE/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl new file mode 100644 index 0000000..9c2b99e Binary files /dev/null and b/setup/SE/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl b/setup/SE/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl new file mode 100644 index 0000000..622ca81 Binary files /dev/null and b/setup/SE/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/idna-2.6-py2.py3-none-any.whl b/setup/SE/share/python-wheels/idna-2.6-py2.py3-none-any.whl new file mode 100644 index 0000000..931fd78 Binary files /dev/null and b/setup/SE/share/python-wheels/idna-2.6-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl b/setup/SE/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl new file mode 100644 index 0000000..07bb9aa Binary files /dev/null and b/setup/SE/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl b/setup/SE/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl new file mode 100644 index 0000000..2a076fd Binary files /dev/null and b/setup/SE/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/packaging-17.1-py2.py3-none-any.whl b/setup/SE/share/python-wheels/packaging-17.1-py2.py3-none-any.whl new file mode 100644 index 0000000..d55806c Binary files /dev/null and b/setup/SE/share/python-wheels/packaging-17.1-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl b/setup/SE/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl new file mode 100644 index 0000000..c1d4459 Binary files /dev/null and b/setup/SE/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl b/setup/SE/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl new file mode 100644 index 0000000..3bfe591 Binary files /dev/null and b/setup/SE/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/progress-1.2-py2.py3-none-any.whl b/setup/SE/share/python-wheels/progress-1.2-py2.py3-none-any.whl new file mode 100644 index 0000000..e364076 Binary files /dev/null and b/setup/SE/share/python-wheels/progress-1.2-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl b/setup/SE/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl new file mode 100644 index 0000000..0ad3e6c Binary files /dev/null and b/setup/SE/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl b/setup/SE/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl new file mode 100644 index 0000000..3ab4c73 Binary files /dev/null and b/setup/SE/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl b/setup/SE/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl new file mode 100644 index 0000000..f5950d4 Binary files /dev/null and b/setup/SE/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl b/setup/SE/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl new file mode 100644 index 0000000..4f5b289 Binary files /dev/null and b/setup/SE/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/six-1.11.0-py2.py3-none-any.whl b/setup/SE/share/python-wheels/six-1.11.0-py2.py3-none-any.whl new file mode 100644 index 0000000..59932b4 Binary files /dev/null and b/setup/SE/share/python-wheels/six-1.11.0-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl b/setup/SE/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl new file mode 100644 index 0000000..c84f23e Binary files /dev/null and b/setup/SE/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl b/setup/SE/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl new file mode 100644 index 0000000..4eaf745 Binary files /dev/null and b/setup/SE/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl differ diff --git a/setup/SE/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl b/setup/SE/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl new file mode 100644 index 0000000..609a368 Binary files /dev/null and b/setup/SE/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl differ diff --git a/setup/requirments.txt b/setup/requirements.txt similarity index 100% rename from setup/requirments.txt rename to setup/requirements.txt diff --git a/setup/setup.sh b/setup/setup.sh index cff3c72..bed9a23 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -90,7 +90,7 @@ func_install_env(){ } func_install_pip(){ - pip install -r setup/requirments.txt + pip install -r ./requirements.txt } # Menu Case Statement