wooey / clinto

This converts an assortment of python command line interfaces into a language agnostic build spec for usage in GUI creation.
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

Add zip support for clinto #30

Closed pymenow closed 6 years ago

pymenow commented 6 years ago

OK So here is what I did : I bundle up my project as below lib/ mainpy

the lib folder has all libs specific to my project. I renamed my main script to main.py

I then zip the contents up into reportgen.zip I renamed this to reportgen.py

and now I can execute this directly as such : python reportgen.py locally. However importing this into wooey gives the below error : Request Method: POST
http://URL/admin/wooey/script/add/  
1.9.13  
UnicodeDecodeError  
'utf-8' codec can't decode byte 0x9a in position 12: invalid start byte  
/opt/anaconda/anaconda3/lib/python3.6/codecs.py in decode, line 321  
/opt/anaconda/anaconda3/bin/python  

3.6.3

Chris7 commented 6 years ago

Hey @pymenow , thanks for your reports over the past few weeks. I'm currently swamped with my normal work, but intend to support this. For now, the best way to get this moving (other than forking the code and submitting a PR) is to post the zip you are trying to work with so when I have time I have a testing asset ready

pymenow commented 6 years ago

@Chris7 PFA the zip its stripped down but its good for tests. wooeytest.zip

It will need a csv file to be passed , so any csv file should be good. expected output with any csv file named test.csv passed . python wooeytest.zip -f test.csv

50 51 52 53 54 Test 1 Passed

<_io.TextIOWrapper name='test.csv' mode='r' encoding='cp1252'> split n None None n 25 ['28.0', '32.0', '40.0'] line default 10.3 35.3 ['First', 'Second', 'Third', 'Last one'] Last test: [[10, 15.5], [15.6, 17], [17, 21], [21, 30], [31, 35], [36, 43]] [[18, 29], [29, 32], [32, 40], [40, 58], [60, 68], [70, 84]]
pymenow commented 6 years ago

Actually use this , it also includes a default test.csv file which is also zipped up. So should cover binary / other file inclusions as well. wooeytest2.zip python wooeytest2.zip

50 51 52 53 54 Test 1 Passed

<_io.TextIOWrapper name='lib/test.csv' mode='r' encoding='cp1252'> split n None None n 25 ['28.0', '32.0', '40.0'] line default 10.3 35.3 ['First', 'Second', 'Third', 'Last one'] Last test: [[10, 15.5], [15.6, 17], [17, 21], [21, 30], [31, 35], [36, 43]] [[18, 29], [29, 32], [32, 40], [40, 58], [60, 68], [70, 84]]
Chris7 commented 6 years ago

Implemented via #31