Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.io.base
Commits
77c107fd
Commit
77c107fd
authored
Aug 31, 2016
by
Amir MOHAMMADI
Browse files
Add with statement support to File and HDF5File
parent
496df70c
Pipeline
#3629
passed with stages
in 54 minutes and 58 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
bob/io/base/__init__.py
View file @
77c107fd
...
...
@@ -5,13 +5,34 @@ import bob.core
import
bob.extension
bob
.
extension
.
load_bob_library
(
'bob.io.base'
,
__file__
)
from
._library
import
File
,
HDF5File
,
extensions
from
._library
import
File
as
File_C
,
HDF5File
as
HDF5File_C
,
extensions
from
.
import
version
from
.version
import
module
as
__version__
from
.version
import
api
as
__api_version__
import
os
class
File
(
File_C
):
__doc__
=
File_C
.
__doc__
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
type
,
value
,
traceback
):
self
.
close
()
class
HDF5File
(
HDF5File_C
):
__doc__
=
HDF5File_C
.
__doc__
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
type
,
value
,
traceback
):
self
.
close
()
def
_is_string
(
s
):
"""Returns ``True`` if the given object is a string
...
...
Amir MOHAMMADI
@amohammadi
mentioned in issue
#11 (closed)
·
Aug 31, 2016
mentioned in issue
#11 (closed)
mentioned in issue #11
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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