Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lesson Template
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
prace-lessons
Lesson Template
Commits
71934259
Commit
71934259
authored
8 years ago
by
Greg Wilson
Browse files
Options
Downloads
Plain Diff
Merge branch 'gh-pages' of github.com:gvwilson/new-template into gh-pages
parents
4b9fd4f4
fe6be566
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/jekyllcat
+0
-54
0 additions, 54 deletions
bin/jekyllcat
with
0 additions
and
54 deletions
bin/jekyllcat
deleted
100755 → 0
+
0
−
54
View file @
4b9fd4f4
#!/usr/bin/env python
import
sys
from
optparse
import
OptionParser
def
main
():
'''
Main driver.
'''
parser
=
OptionParser
()
parser
.
add_option
(
'
-o
'
,
'
--opening
'
,
default
=
None
,
dest
=
'
opening
'
,
help
=
'
Header string
'
)
parser
.
add_option
(
'
-c
'
,
'
--closing
'
,
default
=
None
,
dest
=
'
closing
'
,
help
=
'
Footer string
'
)
args
,
extras
=
parser
.
parse_args
()
assert
args
.
opening
and
args
.
closing
,
\
'
Must specify opening (-o) and closing (-c) delimiters
'
opening
=
closing
=
None
bodies
=
[]
if
not
extras
:
opening
,
content
,
closing
=
extract
(
args
,
sys
.
stdin
)
else
:
for
filename
in
extras
:
with
open
(
filename
,
'
r
'
)
as
reader
:
o
,
content
,
c
=
extract
(
args
,
reader
)
if
opening
is
None
:
opening
=
o
closing
=
c
bodies
.
append
(
content
)
display
(
opening
,
*
bodies
,
closing
)
def
extract
(
args
,
reader
):
'''
Extract content from named file.
'''
data
=
reader
.
read
()
i_opening
=
data
.
find
(
args
.
opening
)
+
len
(
args
.
opening
)
i_closing
=
data
.
rfind
(
args
.
closing
)
return
data
[:
i_opening
],
data
[
i_opening
:
i_closing
],
data
[
i_closing
:]
def
display
(
*
blocks
):
'''
Display all the text.
'''
for
b
in
blocks
:
print
(
b
)
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment