Clean up.
This commit is contained in:
parent
d7bdcd66d0
commit
22bf1cfed5
4 changed files with 7 additions and 17 deletions
|
@ -31,8 +31,6 @@
|
|||
*/
|
||||
package net.thauvin.erik.mobibot
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* The `Constants`.
|
||||
*/
|
||||
|
@ -87,11 +85,6 @@ object Constants {
|
|||
*/
|
||||
const val LINK_CMD = "L"
|
||||
|
||||
/**
|
||||
* Default locale.
|
||||
*/
|
||||
val LOCALE: Locale = Locale.getDefault()
|
||||
|
||||
/**
|
||||
* The empty title string.
|
||||
*/
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
*/
|
||||
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.buildCmdSyntax
|
||||
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) {
|
||||
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) {
|
||||
if (isPinboardEnabled) {
|
||||
deletePin(pinboard, entry)
|
||||
PinboardUtils.deletePin(pinboard, entry)
|
||||
}
|
||||
if (twitter.isAutoPost) {
|
||||
twitter.removeEntry(index)
|
||||
|
@ -506,7 +503,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert
|
|||
*/
|
||||
fun updatePin(oldUrl: String, entry: EntryLink) {
|
||||
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
|
||||
fun main(args: Array<String>) {
|
||||
// Setup the command line options
|
||||
// Set up the command line options
|
||||
val options = Options()
|
||||
.addOption(
|
||||
Constants.HELP_ARG.substring(0, 1),
|
||||
|
|
|
@ -68,7 +68,7 @@ object PinboardUtils {
|
|||
* Deletes a pin.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun deletePin(poster: PinboardPoster, entry: EntryLink) {
|
||||
fun deletePin(poster: PinboardPoster, entry: EntryLink) {
|
||||
runBlocking {
|
||||
launch {
|
||||
poster.deletePin(entry.link)
|
||||
|
@ -80,7 +80,7 @@ object PinboardUtils {
|
|||
* Updates a pin.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun updatePin(poster: PinboardPoster, ircServer: String, oldUrl: String, entry: EntryLink) {
|
||||
fun updatePin(poster: PinboardPoster, ircServer: String, oldUrl: String, entry: EntryLink) {
|
||||
runBlocking {
|
||||
launch {
|
||||
with(entry) {
|
||||
|
|
|
@ -49,7 +49,7 @@ class Calc(bot: Mobibot) : AbstractModule(bot) {
|
|||
isPrivate: Boolean
|
||||
) {
|
||||
if (args.isNotBlank()) {
|
||||
with (bot) {
|
||||
with(bot) {
|
||||
try {
|
||||
send(calculate(args))
|
||||
} catch (e: IllegalArgumentException) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue