Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xfw
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
xfw
Commits
597bbe69
Commit
597bbe69
authored
Nov 25, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README: add .rst extension.
Also, use double-colon before literal code.
parent
726996ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
README.rst
README.rst
+6
-6
No files found.
README
→
README
.rst
View file @
597bbe69
...
@@ -48,11 +48,11 @@ with a time (HHMMSS), followed by fields which depend on row type:
...
@@ -48,11 +48,11 @@ with a time (HHMMSS), followed by fields which depend on row type:
- type 2: a 2-char integer, 8 chars of padding, a 1-char integer
- type 2: a 2-char integer, 8 chars of padding, a 1-char integer
To run the following code as a doctest, run:
To run the following code as a doctest, run:
:
python -m doctest README
python -m doctest README
.rst
Declare all file structures:
Declare all file structures:
:
>>> import xfw
>>> import xfw
>>> ROOT_HEADER = xfw.FieldList([
>>> ROOT_HEADER = xfw.FieldList([
...
@@ -99,7 +99,7 @@ Declare all file structures:
...
@@ -99,7 +99,7 @@ Declare all file structures:
... separator='\n',
... separator='\n',
... )
... )
Parse sample file through a hash helper wrapper (SHA1):
Parse sample file through a hash helper wrapper (SHA1):
:
>>> from cStringIO import StringIO
>>> from cStringIO import StringIO
>>> sample_file = StringIO(
>>> sample_file = StringIO(
...
@@ -151,13 +151,13 @@ Parse sample file through a hash helper wrapper (SHA1):
...
@@ -151,13 +151,13 @@ Parse sample file through a hash helper wrapper (SHA1):
... )
... )
True
True
Verify SHA1 was properly accumulated:
Verify SHA1 was properly accumulated:
:
>>> import hashlib
>>> import hashlib
>>> hashlib.sha1(sample_file.getvalue()).hexdigest() == checksumed_wrapper.getHexDigest()
>>> hashlib.sha1(sample_file.getvalue()).hexdigest() == checksumed_wrapper.getHexDigest()
True
True
Generate a file from parsed data (as it was verified correct above):
Generate a file from parsed data (as it was verified correct above):
:
>>> generated_stream = StringIO()
>>> generated_stream = StringIO()
>>> FILE_STRUCTURE.generateStream(generated_stream, parsed_file)
>>> FILE_STRUCTURE.generateStream(generated_stream, parsed_file)
...
...
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