Mercurial > cgi-bin > hgweb.cgi > ImagePrep
comparison src/name/blackcap/imageprep/Settings.kt @ 1:0bded24f746e
Compiles, still untested.
author | David Barts <n5jrn@me.com> |
---|---|
date | Thu, 16 Jul 2020 21:51:08 -0700 |
parents | e0efe7848130 |
children | a6f9b51d5e8d |
comparison
equal
deleted
inserted
replaced
0:e0efe7848130 | 1:0bded24f746e |
---|---|
1 /* | 1 /* |
2 * Our settings. Basically just some parsed properties. | 2 * Our settings. Basically just some parsed properties. |
3 */ | 3 */ |
4 package name.blackcap.imageprep | 4 package name.blackcap.imageprep |
5 | |
6 import java.io.File | |
5 | 7 |
6 /* work around name shadowing */ | 8 /* work around name shadowing */ |
7 private val _PROPS = PROPERTIES | 9 private val _PROPS = PROPERTIES |
8 | 10 |
9 object Settings { | 11 object Settings { |
16 | 18 |
17 private fun tilde(s: String): String { | 19 private fun tilde(s: String): String { |
18 if (s.isNullOrEmpty()) | 20 if (s.isNullOrEmpty()) |
19 return homeDir | 21 return homeDir |
20 if (s.startsWith("~/") || s.startsWith("~\\")) | 22 if (s.startsWith("~/") || s.startsWith("~\\")) |
21 return File(homeDir, s.substring(1).trimStart('/', '\\')).toString() | 23 return File(homeDir, s.substring(2).trimStart(s[1])).toString() |
22 else | 24 else |
23 return s | 25 return s |
24 } | 26 } |
25 | 27 |
26 private fun strToBool(s: String): Boolean { | 28 private fun strToBool(s: String): Boolean { |