Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.pad.base
Commits
b28bffe9
There was a problem fetching the pipeline summary.
Commit
b28bffe9
authored
7 years ago
by
Pavel KORSHUNOV
Browse files
Options
Downloads
Patches
Plain Diff
putting back the fix from commit
c49ad044
parent
02fe6e88
No related branches found
No related tags found
1 merge request
!13
Support for configuration files
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/base/test/dummy/database.py
+10
-8
10 additions, 8 deletions
bob/pad/base/test/dummy/database.py
bob/pad/base/test/dummy/database_sql.py
+5
-3
5 additions, 3 deletions
bob/pad/base/test/dummy/database_sql.py
with
15 additions
and
11 deletions
bob/pad/base/test/dummy/database.py
+
10
−
8
View file @
b28bffe9
...
@@ -33,7 +33,7 @@ class TestFile(PadFile):
...
@@ -33,7 +33,7 @@ class TestFile(PadFile):
attack_type
=
None
attack_type
=
None
if
"
attack
"
in
path
:
if
"
attack
"
in
path
:
attack_type
=
"
attack
"
attack_type
=
"
attack
"
PadFile
.
__init__
(
self
,
client_id
=
1
,
path
=
path
,
file_id
=
id
,
attack_type
=
attack_type
)
super
(
TestFile
,
self
)
.
__init__
(
client_id
=
1
,
path
=
path
,
file_id
=
id
,
attack_type
=
attack_type
)
def
load
(
self
,
directory
=
None
,
extension
=
'
.hdf5
'
):
def
load
(
self
,
directory
=
None
,
extension
=
'
.hdf5
'
):
"""
Loads the data at the specified location and using the given extension.
"""
Loads the data at the specified location and using the given extension.
...
@@ -96,11 +96,13 @@ class Interface(BaseInterface):
...
@@ -96,11 +96,13 @@ class Interface(BaseInterface):
dumpparser
=
subparsers
.
add_parser
(
'
dumplist
'
,
help
=
""
)
dumpparser
=
subparsers
.
add_parser
(
'
dumplist
'
,
help
=
""
)
dumpparser
.
add_argument
(
'
-d
'
,
'
--directory
'
,
dest
=
"
directory
"
,
default
=
''
,
dumpparser
.
add_argument
(
'
-d
'
,
'
--directory
'
,
dest
=
"
directory
"
,
default
=
''
,
help
=
"
if given, this path will be prepended to every entry returned (defaults to
'
%(default)s
'
)
"
)
help
=
"
if given, this path will be prepended to every entry returned
"
"
(defaults to
'
%(default)s
'
)
"
)
dumpparser
.
add_argument
(
'
-e
'
,
'
--extension
'
,
dest
=
"
extension
"
,
default
=
''
,
dumpparser
.
add_argument
(
'
-e
'
,
'
--extension
'
,
dest
=
"
extension
"
,
default
=
''
,
help
=
"
if given, this extension will be appended to every entry returned (defaults to
'
%(default)s
'
)
"
)
help
=
"
if given, this extension will be appended to every entry returned
"
"
(defaults to
'
%(default)s
'
)
"
)
dumpparser
.
add_argument
(
'
--self-test
'
,
dest
=
"
selftest
"
,
default
=
False
,
dumpparser
.
add_argument
(
'
--self-test
'
,
dest
=
"
selftest
"
,
default
=
False
,
action
=
'
store_true
'
,
help
=
SUPPRESS
)
action
=
'
store_true
'
,
help
=
SUPPRESS
)
dumpparser
.
set_defaults
(
func
=
dumplist
)
# action
dumpparser
.
set_defaults
(
func
=
dumplist
)
# action
...
@@ -110,9 +112,9 @@ class TestDatabase(PadDatabase):
...
@@ -110,9 +112,9 @@ class TestDatabase(PadDatabase):
def
__init__
(
self
,
protocol
=
'
Default
'
,
original_directory
=
data_dir
,
original_extension
=
''
,
**
kwargs
):
def
__init__
(
self
,
protocol
=
'
Default
'
,
original_directory
=
data_dir
,
original_extension
=
''
,
**
kwargs
):
# call base class constructors to open a session to the database
# call base class constructors to open a session to the database
Pad
Database
.
__init__
(
self
,
name
=
'
testspoof
'
,
protocol
=
protocol
,
super
(
Test
Database
,
self
)
.
__init__
(
name
=
'
testspoof
'
,
protocol
=
protocol
,
original_directory
=
original_directory
,
original_directory
=
original_directory
,
original_extension
=
original_extension
,
**
kwargs
)
original_extension
=
original_extension
,
**
kwargs
)
################################################
################################################
# Low level support methods for the database #
# Low level support methods for the database #
...
@@ -194,4 +196,4 @@ class TestDatabase(PadDatabase):
...
@@ -194,4 +196,4 @@ class TestDatabase(PadDatabase):
return
None
return
None
database
=
TestDatabase
(
original_directory
=
data_dir
,
original_extension
=
''
)
database
=
TestDatabase
()
This diff is collapsed.
Click to expand it.
bob/pad/base/test/dummy/database_sql.py
+
5
−
3
View file @
b28bffe9
...
@@ -45,10 +45,12 @@ def create_database():
...
@@ -45,10 +45,12 @@ def create_database():
del
engine
del
engine
class
TestDatabaseSql
(
bob
.
pad
.
base
.
database
.
PadDatabase
,
bob
.
db
.
base
.
SQLiteDatabase
):
class
TestDatabaseSql
(
bob
.
pad
.
base
.
database
.
PadDatabase
,
bob
.
db
.
base
.
SQLiteBaseDatabase
):
def
__init__
(
self
):
def
__init__
(
self
):
bob
.
pad
.
base
.
database
.
PadDatabase
.
__init__
(
self
,
'
pad_test
'
,
original_directory
=
"
original/directory
"
,
original_extension
=
"
.orig
"
)
bob
.
pad
.
base
.
database
.
PadDatabase
.
__init__
(
self
,
'
pad_test
'
,
bob
.
db
.
base
.
SQLiteDatabase
.
__init__
(
self
,
dbfile
,
TestFileSql
)
original_directory
=
"
original/directory
"
,
original_extension
=
"
.orig
"
)
bob
.
db
.
base
.
SQLiteBaseDatabase
.
__init__
(
self
,
dbfile
,
TestFileSql
)
def
groups
(
self
,
protocol
=
None
):
def
groups
(
self
,
protocol
=
None
):
return
[
'
group
'
]
return
[
'
group
'
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment