Mercurial > cgi-bin > hgweb.cgi > ImagePrep
comparison src/name/blackcap/imageprep/Settings.kt @ 2:a6f9b51d5e8d
Got jar building.
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 17 Jul 2020 10:34:48 -0700 |
parents | 0bded24f746e |
children | 5234e4500d45 |
comparison
equal
deleted
inserted
replaced
1:0bded24f746e | 2:a6f9b51d5e8d |
---|---|
7 | 7 |
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 var homeDir = System.getProperty("user.home") | 12 private val homeDir = System.getProperty("user.home") |
13 val maxDimension = _PROPS.getProperty("maxDimension").toInt() | 13 val maxDimension = _PROPS.getProperty("maxDimension").toInt() |
14 val outputQuality = _PROPS.getProperty("outputQuality").toInt() | 14 val outputQuality = _PROPS.getProperty("outputQuality").toInt() |
15 val outputSuffix = tilde(_PROPS.getProperty("outputSuffix")) | 15 val outputSuffix = _PROPS.getProperty("outputSuffix") |
16 val outputTo = tilde(_PROPS.getProperty("outputTo")) | 16 val outputTo = tilde(_PROPS.getProperty("outputTo")) |
17 val outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir")) | 17 val 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("~\\")) |
23 return File(homeDir, s.substring(2).trimStart(s[1])).toString() | 23 return File(homeDir, s.substring(2).trimStart(s[1])).toString() |
24 else | 24 else |