Commit bfd21fe7 authored by Denis Salem's avatar Denis Salem
Browse files

fix disabled escape processing

fix disabled escape processing
parent b269ceff
......@@ -98,7 +98,7 @@ En utilisant le motif __IncludeFile__ comme suit
Libérer la Corée du Nord::
Terraformer la lune::
Découvrir la matière exotique et commercialiser les trous de ver pour le voyage interstellaire::
Nourrir Freki, mon chiens.
Nourrir Tacos, mon chiens.
:. ::EndEscape:.
nous obtiendrions
......@@ -127,7 +127,8 @@ Ce motif ne prend qu'un seul paramètre.
# .:IncludeFile::true::escape:.
.:Escape:: .:Escape:: ::EndEscape:. ::EndEscape:.
Ce motif est traité un peu différement des autres. Il permet d'ignorer les motifs contenu à l'intérieur
du texte de l'unique argument __content__.
Ce motif ne peut pas s'échapter lui même. Pour ignorer ce motif, il doit être inclu dans un fichier avec
le pattern _IncludeFile_.
......@@ -169,12 +169,13 @@
DONE | Fix url with special char in chapter.
DONE | Add CodeHighlightInclude
DONE | Reorganize themes dependencies in setup.
DONE | Print out what's going on while FTP transfert.
WIP | Add relevant templates for themes.
WIP | Client-side search engine.
WIP | Add definition in documentation for optional fields in blog configuration.
WIP | Change nomenclature: Most of the usual patterns are changed. Fix doc.
DONE | Documenter le type des métadonnées: list, str ou dict
DONE | Fix chapters rendering (only first level sub-chapter are rendered for now)
DONE | Fix chapters rendering (only first level sub-chapter were rendered)
# version 2.1.x
TODO | SetBackgroundColor for text
......@@ -205,7 +206,6 @@
TODO | Add Yaml comments in blog configuration.
TODO | Add nice 404 errors page.
TODO | Improve Feed.
TODO | Print out what's going on while FTP transfert.
TODO | Warn about entry title duplicates.
TODO | Handle missing args in case of unknown number of args (Pattern).
TODO | Add configuration field type check.
......
......@@ -73,6 +73,7 @@ def ftp_export_recursively(origin, ftp):
notify(item+": "+str(e), color="YELLOW")
else:
notify("Uploaded: "+ftp.pwd()+"/"+item)
ftp.storbinary("STOR "+ftp.pwd()+"/"+item, open(origin+"/"+item, 'rb'))
def ftp_clean_destination(ftp):
......@@ -83,10 +84,13 @@ def ftp_clean_destination(ftp):
if item not in ['.','..']:
try:
ftp.delete(item)
notify("Deleted: "+ftp.pwd()+"/"+item)
except Exception:
try:
ftp.rmd(item)
notify("Deleted: "+ftp.pwd()+"/"+item)
except:
ftp.cwd(ftp.pwd()+"/"+item)
......
......@@ -34,7 +34,7 @@ class Theme:
self.atom_footer = ProcessedString(open(theme_folder+"chunks/atomFooter.xml",'r').read(), "atomFooter.html")
self.entry = EntryWrapper(open(theme_folder+"chunks/entry.html",'r').read(), "entry.html")
self.rss_entry = EntryWrapper(open(theme_folder+"chunks/rssEntry.xml",'r').read(),"rssEntry.xxml")
self.rss_entry = EntryWrapper(open(theme_folder+"chunks/rssEntry.xml",'r').read(),"rssEntry.xml")
self.atom_entry = EntryWrapper(open(theme_folder+"chunks/atomEntry.xml",'r').read(),"atomEntry.xml")
self.audio = open(theme_folder+"chunks/audio.html",'r').read()
......
......@@ -203,10 +203,7 @@ class ProcessedString():
self.keep_appart_from_markup_inc = 0
self.bop, self.bcp = [], []
self.backup = None
def do_again(self):
self.__init__(self.string, self.ressource, self.process_escapes)
def restore(self):
self.open_pattern_pos, self.close_pattern_pos, self.len_open_pattern_pos, self.len_close_pattern_pos, self.string = self.backup
self.backup = None
......@@ -233,7 +230,7 @@ class ProcessedString():
# After markup langage processing done, indexes are messed up.
keep_appart_from_markup_indexes = self.keep_appart_from_markup_indexes
self.do_again()
self.__init__(self.string, self.ressource, True)
self.keep_appart_from_markup_indexes = keep_appart_from_markup_indexes
# Last round is about replacing needles and fix one last time indexes
......@@ -473,5 +470,4 @@ class Processor():
extra_pre_processed = ProcessedString(new_chunk, pre_processed.ressource, True)
self.process(extra_pre_processed, safe_process)
print(ignore_patterns, pre_processed.process_escapes, new_chunk)
pre_processed.keep_appart_from_markup_indexes[index] = (index, paragraphe, extra_pre_processed.string if not ignore_patterns else new_chunk)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment