Clean up.

This commit is contained in:
Erik C. Thauvin 2021-10-25 13:02:57 -07:00
parent d7bdcd66d0
commit 22bf1cfed5
4 changed files with 7 additions and 17 deletions

View file

@ -31,8 +31,6 @@
*/ */
package net.thauvin.erik.mobibot package net.thauvin.erik.mobibot
import java.util.Locale
/** /**
* The `Constants`. * The `Constants`.
*/ */
@ -87,11 +85,6 @@ object Constants {
*/ */
const val LINK_CMD = "L" const val LINK_CMD = "L"
/**
* Default locale.
*/
val LOCALE: Locale = Locale.getDefault()
/** /**
* The empty title string. * The empty title string.
*/ */

View file

@ -31,9 +31,6 @@
*/ */
package net.thauvin.erik.mobibot package net.thauvin.erik.mobibot
import net.thauvin.erik.mobibot.PinboardUtils.addPin
import net.thauvin.erik.mobibot.PinboardUtils.deletePin
import net.thauvin.erik.mobibot.PinboardUtils.updatePin
import net.thauvin.erik.mobibot.Utils.appendIfMissing import net.thauvin.erik.mobibot.Utils.appendIfMissing
import net.thauvin.erik.mobibot.Utils.buildCmdSyntax import net.thauvin.erik.mobibot.Utils.buildCmdSyntax
import net.thauvin.erik.mobibot.Utils.colorize import net.thauvin.erik.mobibot.Utils.colorize
@ -196,7 +193,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert
*/ */
fun addPin(entry: EntryLink) { fun addPin(entry: EntryLink) {
if (isPinboardEnabled) { if (isPinboardEnabled) {
addPin(pinboard, ircServer, entry) PinboardUtils.addPin(pinboard, ircServer, entry)
} }
} }
@ -236,7 +233,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert
*/ */
fun deletePin(index: Int, entry: EntryLink) { fun deletePin(index: Int, entry: EntryLink) {
if (isPinboardEnabled) { if (isPinboardEnabled) {
deletePin(pinboard, entry) PinboardUtils.deletePin(pinboard, entry)
} }
if (twitter.isAutoPost) { if (twitter.isAutoPost) {
twitter.removeEntry(index) twitter.removeEntry(index)
@ -506,7 +503,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert
*/ */
fun updatePin(oldUrl: String, entry: EntryLink) { fun updatePin(oldUrl: String, entry: EntryLink) {
if (isPinboardEnabled) { if (isPinboardEnabled) {
updatePin(pinboard, ircServer, oldUrl, entry) PinboardUtils.updatePin(pinboard, ircServer, oldUrl, entry)
} }
} }
@ -526,7 +523,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert
*/ */
@JvmStatic @JvmStatic
fun main(args: Array<String>) { fun main(args: Array<String>) {
// Setup the command line options // Set up the command line options
val options = Options() val options = Options()
.addOption( .addOption(
Constants.HELP_ARG.substring(0, 1), Constants.HELP_ARG.substring(0, 1),

View file

@ -68,7 +68,7 @@ object PinboardUtils {
* Deletes a pin. * Deletes a pin.
*/ */
@JvmStatic @JvmStatic
fun deletePin(poster: PinboardPoster, entry: EntryLink) { fun deletePin(poster: PinboardPoster, entry: EntryLink) {
runBlocking { runBlocking {
launch { launch {
poster.deletePin(entry.link) poster.deletePin(entry.link)
@ -80,7 +80,7 @@ object PinboardUtils {
* Updates a pin. * Updates a pin.
*/ */
@JvmStatic @JvmStatic
fun updatePin(poster: PinboardPoster, ircServer: String, oldUrl: String, entry: EntryLink) { fun updatePin(poster: PinboardPoster, ircServer: String, oldUrl: String, entry: EntryLink) {
runBlocking { runBlocking {
launch { launch {
with(entry) { with(entry) {

View file

@ -49,7 +49,7 @@ class Calc(bot: Mobibot) : AbstractModule(bot) {
isPrivate: Boolean isPrivate: Boolean
) { ) {
if (args.isNotBlank()) { if (args.isNotBlank()) {
with (bot) { with(bot) {
try { try {
send(calculate(args)) send(calculate(args))
} catch (e: IllegalArgumentException) { } catch (e: IllegalArgumentException) {