Skip to content

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

@ghost

Description

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions