Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
work.species-of-things
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
osp
work.species-of-things
Commits
452ca613
Commit
452ca613
authored
8 years ago
by
gijs
Browse files
Options
Downloads
Patches
Plain Diff
Removed old file
parent
ad64bda4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/immaterial.py
+0
-92
0 additions, 92 deletions
scripts/immaterial.py
with
0 additions
and
92 deletions
scripts/immaterial.py
deleted
100644 → 0
+
0
−
92
View file @
ad64bda4
import
re
import
urllib
import
argparse
pads
=
[
'
http://10.10.161.238/ether/p/polyhistor/export/txt
'
,
'
http://10.10.161.238/ether/p/etymologiae/export/txt
'
,
'
http://10.10.161.238/ether/p/cyclopaedia/export/txt
'
,
'
http://10.10.161.238/ether/p/encyclopedia/export/txt
'
,
'
http://10.10.161.238/ether/p/greatinventions/export/txt
'
,
# 'http://10.10.161.238/ether/p/taric/export/txt',
# 'http://10.10.161.238/ether/p/amazon/export/txt'
]
# pads = [
# '../classification-systems/encyclopedia.txt',
# '../classification-systems/cyclopaedia.txt',
# '../classification-systems/greatinventions.txt',
# '../classification-systems/polyhistor.txt',
# '../classification-systems/etymologiae.txt',
# '../classification-systems/taric.txt'
# '../classification-systems/amazon.txt'
# ]
fileout
=
open
(
"
../../stories/boxes.html
"
,
"
w+
"
)
# fileout = open("../html2print/stories/boxes.html","w+") # to work locally
for
pad
in
pads
:
c
=
0
lines
=
urllib
.
urlopen
(
pad
).
readlines
()
padname
=
pad
.
replace
(
'
../classification-systems/
'
,
''
)
padname
=
padname
.
replace
(
'
.txt
'
,
''
)
padname
=
padname
.
replace
(
'
http://10.10.161.238/ether/p/
'
,
''
)
padname
=
padname
.
replace
(
'
/export/txt
'
,
''
)
for
line
in
lines
:
line
=
re
.
sub
(
'
\s{8}
'
,
'
\t
'
,
line
)
m
=
re
.
search
(
r
"
^\t*
"
,
line
)
if
m
:
tab
=
len
(
m
.
group
(
0
))
+
1
strtab
=
str
(
tab
)
line
=
line
.
replace
(
"
\t
"
,
""
)
if
'
[img]
'
in
line
:
line
=
line
.
replace
(
'
[img]
'
,
'
<span class=
"
annotation
"
><img class=
"
img-annotation
"
src=
"
/html2print/chapters/img/
'
)
line
=
line
+
'"
></span>
'
fileout
.
write
(
line
)
continue
if
'
[annotation]
'
in
line
:
line
=
line
.
replace
(
'
[annotation]
'
,
'
<span class=
"
annotation
"
>
'
)
line
=
line
+
'
</span>
'
fileout
.
write
(
line
)
continue
if
'
[title]
'
in
line
:
line
=
line
.
replace
(
'
[title]
'
,
'
<div class=
"
title
"
>
'
)
line
=
line
+
'
</div>
'
fileout
.
write
(
line
)
continue
if
tab
==
c
:
fileout
.
write
(
'
</div>
\n
'
)
fileout
.
write
(
'
<div class=
"
box level_
'
+
strtab
+
'"
>
'
+
line
)
# print 'tab is same'
# print 'c:', c, 'tab:', tab
if
tab
>
c
:
fileout
.
write
(
'
<div class=
"
box level_
'
+
strtab
+
'"
>
'
+
line
)
# print 'tab is bigger'
# print 'c:', c, 'tab:', tab
if
tab
<
c
:
enddiv
=
'
</div>
\n
'
# print str(c - tab + 1)+ 'x enddiv printed'
fileout
.
write
((
c
-
tab
+
1
)
*
enddiv
)
fileout
.
write
(
'
<div class=
"
box level_
'
+
strtab
+
'"
>
'
+
line
)
# print 'tab is smaller'
# print 'c:', c, 'tab:', tab
c
=
tab
fileout
.
write
((
tab
+
1
)
*
enddiv
)
print
'
*output of system-
'
+
padname
+
'
.html is written*
'
fileout
.
close
()
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