This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import argparse | |
| import threading | |
| import json | |
| import time | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| from urllib.parse import urlencode, quote | |
| import websocket # pip install websocket-client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private object UninitializedValue | |
| open class NullablePreferenceDelegate<T : @Serializable Any?>( | |
| protected val montoya: MontoyaApi, | |
| protected var key: String? = null, | |
| protected val customSerializer: KSerializer<in T>? = null, | |
| protected val default: () -> T? | |
| ) : ReadWriteProperty<Any?, T?> { | |
| protected val preferences: Preferences = montoya.persistence().preferences() | |
| private val json = Json { ignoreUnknownKeys = true } |