Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
16068896
Commit
16068896
authored
Nov 03, 2014
by
Peter van 't Hof
Browse files
Added version cache
parent
9b5aa989
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
View file @
16068896
...
...
@@ -92,7 +92,7 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
protected
def
versionCommand
:
String
=
null
protected
val
versionRegex
:
Regex
=
null
protected
val
versionExitcode
=
List
(
0
)
// Can select multiple
def
getVersion
:
String
=
{
private
def
getVersion
Internal
:
String
=
{
if
(
versionCommand
==
null
||
versionRegex
==
null
)
return
"N/A"
val
stdout
=
new
StringBuffer
()
val
stderr
=
new
StringBuffer
()
...
...
@@ -114,6 +114,12 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
return
"N/A"
}
def
getVersion
:
String
=
{
if
(!
BiopetCommandLineFunctionTrait
.
versionCache
.
contains
(
executable
))
BiopetCommandLineFunctionTrait
.
versionCache
+=
executable
->
getVersionInternal
return
BiopetCommandLineFunctionTrait
.
versionCache
(
executable
)
}
def
getThreads
(
default
:
Int
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
default
=
8
)
val
threads
:
Int
=
config
(
"threads"
,
default
=
default
)
...
...
@@ -128,3 +134,8 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
else
return
maxThreads
}
}
object
BiopetCommandLineFunctionTrait
{
import
scala.collection.mutable.Map
private
val
versionCache
:
Map
[
String
,
String
]
=
Map
()
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment