Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code review ideas: Either check for dependencies or provide a list to install? #14

Open
ghost opened this issue Jul 26, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 26, 2016

The following are requirements for wavetrace

shell

splat
pnmscale
pnmtopng
convert
mv
sed
basename
grep
identify
bc

python

requests
BeautifulSoup
csv

There is no way to get away from the python dependencies (unless you want to convert the project to a shell program) so to simplify using the project, dependencies could be checked at the start and hints given for where to find these.
My system was missing splat, and my virtualenv was missing requests - pretty simple to fix, but some will get tripped up on RedHat/CentOS 5 with where to find convert and identify, or some Ubuntu servers with pnmscale

Pure python solution

Another solution could be requiring libs such as
pip install Pillow
and lean on these kinds of libraries which are (especially in a virtualenv) very stable and easy to document the installation of;

This happens in wavetrace;

extimg=$(echo ${imgname#*.})
bnimg=$(basename $imgname .$extimg)
width=$(identify -format "%w" "$path/${bn}_${bnimg}.$extimg")
height=$(identify -format "%h" "$path/${bn}_${bnimg}.$extimg")

In pure python:

from PIL import Image
im = Image.open(filename) 
w = im.size[0]
h = im.size[1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants