Mercurial > cgi-bin > hgweb.cgi > ImagePrep
view src/name/blackcap/imageprep/Settings.kt @ 17:d71523cde521 prestd
Should be private. Make it so.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 26 Jul 2020 15:17:27 -0700 |
parents | 884f1415a330 |
children |
line wrap: on
line source
/* * Our settings. Basically just some parsed properties. */ package name.blackcap.imageprep import java.io.File /* work around name shadowing */ private val _PROPS = PROPERTIES object Settings { var maxDimension = _PROPS.getProperty("maxDimension").toInt() var outputQuality = _PROPS.getProperty("outputQuality").toInt() var outputSuffix = _PROPS.getProperty("outputSuffix") var outputTo = tilde(_PROPS.getProperty("outputTo")) var outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir")) private fun strToBool(s: String): Boolean { if (s.isNullOrEmpty()) return false val c1 = s[0].toLowerCase() return c1 == 't' || c1 == 'y' } }