Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
juga
sbws
Commits
11ec9846
Commit
11ec9846
authored
Aug 31, 2018
by
juga
Browse files
Add method to parse a V100 header
parent
39219fc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
11ec9846
...
...
@@ -139,6 +139,17 @@ class V3BWHeader(object):
assert
isinstance
(
text
,
str
)
return
self
.
from_lines_v110
(
text
.
split
(
LINE_SEP
))
@
classmethod
def
from_lines_v100
(
cls
,
lines
):
"""
:param list lines: list of lines to parse
:returns: tuple of V3BWHeader object and non-header lines
"""
assert
isinstance
(
lines
,
list
)
h
=
cls
(
lines
[
0
])
# last line is new line
return
h
,
lines
[
1
:
-
1
]
@
staticmethod
def
generator_started_from_file
(
state_fpath
):
'''
...
...
Write
Preview
Supports
Markdown
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