Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Denis Salem
VenC
Commits
7c932b7b
Commit
7c932b7b
authored
Dec 16, 2018
by
Denis Salem
Browse files
fix .:GetEntryTitle recursion
parent
5f33af3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
changelog.md
View file @
7c932b7b
...
...
@@ -147,8 +147,8 @@
DONE | Speed up blog exportation (almost nine times faster!).
DONE | Escape patterns.
DONE | Chapters engine.
DONE | Fix pattern (i.e .:GetEntryTitle:.) access in template's metadata.
TODO | Fix unit test.
TODO | Fix pattern (i.e .:GetEntryTitle:.) access in template's metadata.
TODO | Open with navigator manual.
TODO | Client-side search engine.
TODO | Reorganize themes dependencies in setup (adding default templates, scripts, and pages to include).
...
...
@@ -172,5 +172,5 @@
TODO | Add nice 404 errors page.
TODO | Improve Feed.
TODO | Print out what's going on while FTP transfert.
TODO | Fix gvim / -ex
TODO | Warn about entry title duplicates
TODO | Fix gvim / -ex
.
TODO | Warn about entry title duplicates
.
src/venc2/commands/new.py
View file @
7c932b7b
...
...
@@ -73,8 +73,6 @@ def new_entry(argv):
entry
[
"minute"
]
=
raw_entry_date
.
minute
entry
[
"date"
]
=
raw_entry_date
entry_date
=
str
(
date
.
month
)
+
'-'
+
str
(
date
.
day
)
+
'-'
+
str
(
date
.
year
)
+
'-'
+
str
(
date
.
hour
)
+
'-'
+
str
(
date
.
minute
)
output_filename
=
os
.
getcwd
()
+
'/entries/'
+
str
(
entry
[
"ID"
])
+
"__"
+
entry_date
+
"__"
+
entry
[
"title"
].
replace
(
' '
,
'_'
)
...
...
@@ -84,7 +82,7 @@ def new_entry(argv):
else
:
try
:
output
=
open
(
os
.
getcwd
()
+
'/templates/'
+
argv
[
1
],
'r'
).
read
()
output
=
open
(
os
.
getcwd
()
+
'/templates/'
+
argv
[
1
],
'r'
).
read
()
.
replace
(
".:GetEntryTitle:."
,
argv
[
0
])
except
FileNotFoundError
as
e
:
die
(
messages
.
file_not_found
.
format
(
os
.
getcwd
()
+
"/templates/"
+
argv
[
1
]))
...
...
src/venc2/datastore/entry.py
View file @
7c932b7b
...
...
@@ -111,7 +111,7 @@ class Entry:
)
try
:
self
.
title
=
metadata
[
"title"
]
self
.
title
=
metadata
[
"title"
]
.
replace
(
".:GetEntryTitle:."
,
''
)
except
KeyError
:
die
(
messages
.
missing_mandatory_field_in_entry
.
format
(
"title"
,
self
.
id
))
...
...
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