def find_binaries(cls, tmpdir=None, shellsetup=None, pnmdir=None):
        """Set instance variables for directory and binary locations.

        FIXME - should accept params to set things other than defaults.
        """
        cls.tmpdir = ('/tmp' if (tmpdir is None) else tmpdir)
        # Shell setup command (e.g set library path)
        cls.shellsetup = ('' if (shellsetup is None) else shellsetup)
        if (pnmdir is None):
            cls.pnmdir = '/usr/bin'
            for dir in ('/usr/local/bin', '/sw/bin'):
                if (os.path.isfile(os.path.join(dir, 'pngtopnm'))):
                    cls.pnmdir = dir
        else:
            cls.pnmdir = pnmdir
        # Recklessly assume everything else under cls.pnmdir
        cls.pngtopnm = os.path.join(cls.pnmdir, 'pngtopnm')
        cls.jpegtopnm = os.path.join(cls.pnmdir, 'jpegtopnm')
        cls.pnmfile = os.path.join(cls.pnmdir, 'pnmfile')
        cls.pnmcut = os.path.join(cls.pnmdir, 'pnmcut')
        cls.pnmscale = os.path.join(cls.pnmdir, 'pnmscale')
        cls.pnmrotate = os.path.join(cls.pnmdir, 'pnmrotate')
        cls.pnmflip = os.path.join(cls.pnmdir, 'pnmflip')
        cls.pnmtopng = os.path.join(cls.pnmdir, 'pnmtopng')
        cls.ppmtopgm = os.path.join(cls.pnmdir, 'ppmtopgm')
        cls.pnmtotiff = os.path.join(cls.pnmdir, 'pnmtotiff')
        cls.pnmtojpeg = os.path.join(cls.pnmdir, 'pnmtojpeg')
        cls.pamditherbw = os.path.join(cls.pnmdir, 'pamditherbw')
        # Need djatoka to get jp2 output
        cls.djatoka_comp = '/Users/simeon/packages/adore-djatoka-1.1/bin/compress.sh'
def find_binaries ( cls , tmpdir = None , shellsetup = None , pnmdir = None ) : cls . tmpdir = ( '/tmp' if ( tmpdir is None ) else tmpdir ) cls . shellsetup = ( '' if ( shellsetup is None ) else shellsetup ) if ( pnmdir is None ) : cls . pnmdir = '/usr/bin' for dir in ( '/usr/local/bin' , '/sw/bin' ) : if ( os . path . isfile ( os . path . join ( dir , 'pngtopnm' ) ) ) : cls . pnmdir = dir else : cls . pnmdir = pnmdir cls . pngtopnm = os . path . join ( cls . pnmdir , 'pngtopnm' ) cls . jpegtopnm = os . path . join ( cls . pnmdir , 'jpegtopnm' ) cls . pnmfile = os . path . join ( cls . pnmdir , 'pnmfile' ) cls . pnmcut = os . path . join ( cls . pnmdir , 'pnmcut' ) cls . pnmscale = os . path . join ( cls . pnmdir , 'pnmscale' ) cls . pnmrotate = os . path . join ( cls . pnmdir , 'pnmrotate' ) cls . pnmflip = os . path . join ( cls . pnmdir , 'pnmflip' ) cls . pnmtopng = os . path . join ( cls . pnmdir , 'pnmtopng' ) cls . ppmtopgm = os . path . join ( cls . pnmdir , 'ppmtopgm' ) cls . pnmtotiff = os . path . join ( cls . pnmdir , 'pnmtotiff' ) cls . pnmtojpeg = os . path . join ( cls . pnmdir , 'pnmtojpeg' ) cls . pamditherbw = os . path . join ( cls . pnmdir , 'pamditherbw' ) cls . djatoka_comp = '/Users/simeon/packages/adore-djatoka-1.1/bin/compress.sh'
Set instance variables for directory and binary locations.

        FIXME - should accept params to set things other than defaults.