Compare commits
No commits in common. "d62aadb95f689d709343740d1b6a381c9777ad72" and "cc727c681aa287c3e2db2a5b8188d9705f56b252" have entirely different histories.
d62aadb95f
...
cc727c681a
|
|
@ -24,9 +24,4 @@ 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.core_api.interfaces.ProgressBarFactory
|
import de.itkl.fileprocessing.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,7 +1,6 @@
|
||||||
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,4 +1,6 @@
|
||||||
package de.itkl.core_api.interfaces
|
package de.itkl.fileprocessing
|
||||||
|
|
||||||
|
import de.itkl.core_api.interfaces.Resource
|
||||||
|
|
||||||
interface ProgressBarFactory {
|
interface ProgressBarFactory {
|
||||||
fun new(resource: Resource): ProgressBar
|
fun new(resource: Resource): ProgressBar
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package de.itkl.fileprocessing
|
package de.itkl.fileprocessing
|
||||||
|
|
||||||
import de.itkl.core_api.interfaces.ProgressBar
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,8 +11,7 @@ import java.io.InputStream
|
||||||
*/
|
*/
|
||||||
class ProgressInputStream(
|
class ProgressInputStream(
|
||||||
private val inputStream: InputStream,
|
private val inputStream: InputStream,
|
||||||
private val progressBar: ProgressBar
|
private val progressBar: ProgressBar) : InputStream() {
|
||||||
) : InputStream() {
|
|
||||||
@Volatile
|
@Volatile
|
||||||
var bytesRead: Long = 0
|
var bytesRead: Long = 0
|
||||||
private set(value) {
|
private set(value) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
package de.itkl.fileprocessing
|
package de.itkl.fileprocessing
|
||||||
|
|
||||||
import de.itkl.core_api.interfaces.ProgressBarFactory
|
import de.itkl.core_api.interfaces.AbstractResource
|
||||||
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.core_api.interfaces.ProgressBarFactory
|
import de.itkl.fileprocessing.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.core_api.interfaces.ProgressBar
|
import de.itkl.fileprocessing.ProgressBar
|
||||||
import de.itkl.core_api.interfaces.ProgressBarFactory
|
import de.itkl.fileprocessing.ProgressBarFactory
|
||||||
|
|
||||||
class TerminalProgressBarFactory : ProgressBarFactory {
|
class TerminalProgressBarFactory : ProgressBarFactory {
|
||||||
private val terminal = Terminal()
|
private val terminal = Terminal()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
dependencies {
|
|
||||||
api(project(":libraries:core-api"))
|
|
||||||
implementation("com.github.ajalt.mordant:mordant:2.2.0")
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
package de.itkl.tui.implementation
|
|
||||||
|
|
||||||
class TerminalDataTableReporter {
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
package de.itkl.tui
|
|
||||||
|
|
||||||
import org.koin.dsl.module
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add terminal ui capabilities
|
|
||||||
*/
|
|
||||||
val tuiModule = module { }
|
|
||||||
Loading…
Reference in New Issue