Mercurial > cgi-bin > hgweb.cgi > ImagePrep
comparison src/name/blackcap/imageprep/Settings.kt @ 4:5234e4500d45
Command-line arguments (only partially tested).
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 17 Jul 2020 14:51:41 -0700 |
parents | a6f9b51d5e8d |
children | 884f1415a330 |
comparison
equal
deleted
inserted
replaced
3:09dcd475d1bf | 4:5234e4500d45 |
---|---|
8 /* work around name shadowing */ | 8 /* work around name shadowing */ |
9 private val _PROPS = PROPERTIES | 9 private val _PROPS = PROPERTIES |
10 | 10 |
11 object Settings { | 11 object Settings { |
12 private val homeDir = System.getProperty("user.home") | 12 private val homeDir = System.getProperty("user.home") |
13 val maxDimension = _PROPS.getProperty("maxDimension").toInt() | 13 var maxDimension = _PROPS.getProperty("maxDimension").toInt() |
14 val outputQuality = _PROPS.getProperty("outputQuality").toInt() | 14 var outputQuality = _PROPS.getProperty("outputQuality").toInt() |
15 val outputSuffix = _PROPS.getProperty("outputSuffix") | 15 var outputSuffix = _PROPS.getProperty("outputSuffix") |
16 val outputTo = tilde(_PROPS.getProperty("outputTo")) | 16 var outputTo = tilde(_PROPS.getProperty("outputTo")) |
17 val outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir")) | 17 var outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir")) |
18 | 18 |
19 private fun tilde(s: String?): String { | 19 private fun tilde(s: String?): String { |
20 if (s.isNullOrEmpty()) | 20 if (s.isNullOrEmpty()) |
21 return homeDir | 21 return homeDir |
22 if (s.startsWith("~/") || s.startsWith("~\\")) | 22 if (s.startsWith("~/") || s.startsWith("~\\")) |