Compare commits
2 Commits
cc727c681a
...
d62aadb95f
| Author | SHA1 | Date |
|---|---|---|
|
|
d62aadb95f | |
|
|
f777669dfa |
|
|
@ -24,4 +24,9 @@ Abstraction about reading/writing to resources (filesystem, http, s3, etc pp)
|
||||||
<def title="core-api">
|
<def title="core-api">
|
||||||
Defines the core interfaces
|
Defines the core interfaces
|
||||||
</def>
|
</def>
|
||||||
|
<def title="tui">
|
||||||
|
Provides tui capabilities. When applied as koin modules
|
||||||
|
the resources will automatically print a read/write progressbar
|
||||||
|
on terminal.
|
||||||
|
</def>
|
||||||
</deflist>
|
</deflist>
|
||||||
|
|
@ -7,7 +7,7 @@ import com.github.ajalt.clikt.parameters.options.required
|
||||||
import com.github.ajalt.clikt.parameters.types.enum
|
import com.github.ajalt.clikt.parameters.types.enum
|
||||||
import com.github.ajalt.clikt.parameters.types.file
|
import com.github.ajalt.clikt.parameters.types.file
|
||||||
import de.itkl.core_api.coreApiModule
|
import de.itkl.core_api.coreApiModule
|
||||||
import de.itkl.fileprocessing.ProgressBarFactory
|
import de.itkl.core_api.interfaces.ProgressBarFactory
|
||||||
import de.itkl.textprocessing.textProcessingModule
|
import de.itkl.textprocessing.textProcessingModule
|
||||||
import de.itkl.tfidf.Language
|
import de.itkl.tfidf.Language
|
||||||
import de.itkl.tfidf.TerminalProgressBarFactory
|
import de.itkl.tfidf.TerminalProgressBarFactory
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
package de.itkl.fileprocessing
|
package de.itkl.core_api.interfaces
|
||||||
|
|
||||||
import de.itkl.core_api.interfaces.Resource
|
|
||||||
|
|
||||||
interface ProgressBarFactory {
|
interface ProgressBarFactory {
|
||||||
fun new(resource: Resource): ProgressBar
|
fun new(resource: Resource): ProgressBar
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package de.itkl.fileprocessing
|
package de.itkl.fileprocessing
|
||||||
|
|
||||||
import de.itkl.core_api.interfaces.FileProcessor
|
import de.itkl.core_api.interfaces.FileProcessor
|
||||||
|
import de.itkl.core_api.interfaces.ProgressBarFactory
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package de.itkl.fileprocessing
|
package de.itkl.fileprocessing
|
||||||
|
|
||||||
|
import de.itkl.core_api.interfaces.ProgressBar
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -11,7 +12,8 @@ import java.io.InputStream
|
||||||
*/
|
*/
|
||||||
class ProgressInputStream(
|
class ProgressInputStream(
|
||||||
private val inputStream: InputStream,
|
private val inputStream: InputStream,
|
||||||
private val progressBar: ProgressBar) : InputStream() {
|
private val progressBar: ProgressBar
|
||||||
|
) : InputStream() {
|
||||||
@Volatile
|
@Volatile
|
||||||
var bytesRead: Long = 0
|
var bytesRead: Long = 0
|
||||||
private set(value) {
|
private set(value) {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,8 @@
|
||||||
package de.itkl.fileprocessing
|
package de.itkl.fileprocessing
|
||||||
|
|
||||||
import de.itkl.core_api.interfaces.AbstractResource
|
import de.itkl.core_api.interfaces.ProgressBarFactory
|
||||||
import de.itkl.core_api.interfaces.Resource
|
import de.itkl.core_api.interfaces.Resource
|
||||||
import io.ktor.http.*
|
|
||||||
import java.io.File
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.nio.file.Files
|
|
||||||
import java.nio.file.Path
|
|
||||||
import kotlin.io.path.name
|
|
||||||
|
|
||||||
class ProgressResource(
|
class ProgressResource(
|
||||||
private val resource: Resource,
|
private val resource: Resource,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package de.itkl.tfidf
|
||||||
import com.github.doyaaaaaken.kotlincsv.dsl.csvWriter
|
import com.github.doyaaaaaken.kotlincsv.dsl.csvWriter
|
||||||
import de.itkl.core_api.interfaces.FileProcessor
|
import de.itkl.core_api.interfaces.FileProcessor
|
||||||
import de.itkl.core_api.interfaces.Resource
|
import de.itkl.core_api.interfaces.Resource
|
||||||
import de.itkl.fileprocessing.ProgressBarFactory
|
import de.itkl.core_api.interfaces.ProgressBarFactory
|
||||||
import de.itkl.textprocessing.HistogramCsvStorage
|
import de.itkl.textprocessing.HistogramCsvStorage
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import com.github.ajalt.mordant.animation.ProgressAnimation
|
||||||
import com.github.ajalt.mordant.animation.progressAnimation
|
import com.github.ajalt.mordant.animation.progressAnimation
|
||||||
import com.github.ajalt.mordant.terminal.Terminal
|
import com.github.ajalt.mordant.terminal.Terminal
|
||||||
import de.itkl.core_api.interfaces.Resource
|
import de.itkl.core_api.interfaces.Resource
|
||||||
import de.itkl.fileprocessing.ProgressBar
|
import de.itkl.core_api.interfaces.ProgressBar
|
||||||
import de.itkl.fileprocessing.ProgressBarFactory
|
import de.itkl.core_api.interfaces.ProgressBarFactory
|
||||||
|
|
||||||
class TerminalProgressBarFactory : ProgressBarFactory {
|
class TerminalProgressBarFactory : ProgressBarFactory {
|
||||||
private val terminal = Terminal()
|
private val terminal = Terminal()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
dependencies {
|
||||||
|
api(project(":libraries:core-api"))
|
||||||
|
implementation("com.github.ajalt.mordant:mordant:2.2.0")
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
package de.itkl.tui.implementation
|
||||||
|
|
||||||
|
class TerminalDataTableReporter {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package de.itkl.tui.implementation
|
||||||
|
|
||||||
|
import de.itkl.core_api.interfaces.ResourceReadDecorator
|
||||||
|
import java.io.InputStream
|
||||||
|
|
||||||
|
class TerminalProgressBar : ResourceReadDecorator {
|
||||||
|
override fun decorate(length: Long, inputStream: InputStream): InputStream {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package de.itkl.tui
|
||||||
|
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add terminal ui capabilities
|
||||||
|
*/
|
||||||
|
val tuiModule = module { }
|
||||||
Loading…
Reference in New Issue