From b6730f2f77a47ad8d0405aa9f0a542f781803443 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Fri, 27 Oct 2023 17:40:10 +0200 Subject: [PATCH] [1.9.28] - See changelog --- CHANGELOG.md | 12 ++ README.md | 145 ++++++++++-------- src/usr/bin/tyto | 2 +- .../program/__pycache__/check.cpython-311.pyc | Bin 40659 -> 43116 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 10842 -> 11555 bytes .../program/__pycache__/tools.cpython-311.pyc | Bin 7299 -> 7373 bytes .../program/__pycache__/wip.cpython-311.pyc | Bin 9194 -> 9305 bytes src/var/lib/tyto/program/check.py | 109 +++++++++---- src/var/lib/tyto/program/post.py | 81 ++++++---- src/var/lib/tyto/program/tools.py | 15 +- src/var/lib/tyto/program/wip.py | 25 +-- 11 files changed, 254 insertions(+), 135 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 063596b..a7168b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.28] +- readme +- - updated tyto article, with comments to show how to +- multiple targets +- - fix CSS classe name error +- - reset stats, post.error, HEADERS datas +- check process: +- - Added hr and br tags (CSS class name check) +- - fix blockquote title HTML +- - New method to split separator in article +- - fix icode, bcode contents HTML signs (converted) + ## [1.9.27] - fix when target article .tyto is missing - Nearly all stats are added in DB from modules diff --git a/README.md b/README.md index 188c5db..32bbe6a 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,24 @@ tyto ## Exemple d'article ``` - Pour ne pas inclure cet article dans les sitemaps : +#================================================# +# Entete de l'article # +# Fin de l'entête avec au moins 5 tirets "-----" # +# Toute ligne de commentaire "# ..." est ignorée # +#================================================# + +# Pour ne pas inclure cet article dans les sitemaps : ! NoSitemap +# Données uniques sur UNE ligne title: tests d'un article about: À propos de cet article de test -tags: hello, my big world,here +tags: Tyto, tuto, author: echolib -date: 2023-09-30 -logo: /testimg/hi.png +date: 2023-10-27 -link: Lien à reprendre +# Données multiple sur 3 lignes +link: cliquer sur ce Lien https:// Text alternatif @@ -36,89 +43,99 @@ link: Réservez ici https:// Billets -file: voir l'image - PNGs/hi.png - Un png ! - -image: MyCar - PNGs/hi.png - Un png ! - file: télécharger ce fichier - @PDFs/hello.pdf + @/PDFs/hello.pdf Un PDF ! -abbr: css - Cascading StyleSheet - CSS - -abbr: HTML - Hyper Text Markup Langage - HTML - -code: test - @RAWS/test.py - Du code à afficher en HTML - ----- + +#=====================================================================# +# Contenu de l'article # +# Les classe optionnelles non renseignées deviennent celle du domaine # +#=====================================================================# + # La ligne suivante est un commentaire HTML "" ;; Commentaire --> top -#1 Titre en h2 -(( - ;; HTML comment - # Show logo set in header, using '_image:logo' - _image:logo tyto_logo w=120 -)) --> newtitle - #2 Titre en h3 décalé dans le texte +# Ceci est une ancre avec l'ID uniq1 (ID unique) +-> uniq1 +-> top + +# Créer un lien vers l'ancre "uniq1" +>_uniq1: Go to uniq1 anchor_< + +# Ceci est une ligne
ayant pour classe hrcss +-- hrcss + +# Les Titres de l'article de #1 à #5 (

à

) +#1 Titre en h2 + +# Contenu dans un paragraphe ayant pour classe "mypar" +(( mypar + Un long paragraphe... + + # Retour à la ligne avec un
de classe brcss + # (les retours à la ligne vides ne sont pas pris en compte) + | brcss + + Il faut __cliquer sur ce Lien, __Réservez ici et --télécharger ce fichier + ou encore faire une ::CSS pour du beau rendu ::HTML + + # Un paragraphe dans le paragraphe ayant pour classe, celle du domaine (( - Parce que c'est *_bien_* comme /_présentation_/ *_erreur - ou pas, si fermé_* - /_ ;_echolib_; _/ + Un /_court_/ paragraphe de :_1984_: pour de ~_vrai_~ +_faux en gras_+ + Il faut le ._souligner_. et *_Très Gras_* )) + # Créer un icode (utiliser la balise ) + # /!\ ! Doit être sur une ligne + {_
    ,
      _} -(( -Il /_faut_/ ce __Lien à reprendre et __Réservez ici et --télécharger ce fichier -ou encore faire une ::css pour du ::HTML. __Réservez ici et --voir l'image - - icode 1 : {_hello(_world_)_}, icode 2 : {_print("")_} - icode 3 : {_{__}_}, icode 4 : {_echo "Hello"_} )) -(( - _image:MyCar - <: mylist - + Item 1 - ++ Sub-Item 1 - +++ Sub-Sub-item 1 - ==== >_top: Go to Top_< - ==== >_top: Another anchor_< - :> -)) -_code:test -{{ - # Du code brut pour Tyto - {{ - Un exemple de code - }} +#2 Un exemple de block code ayant pour classe python +# Tout contenu entre les marqueurs "{{" et "}}" est conservé +{{ python + # Un commentaire et du code + def hello(world): + world and print(world) or print("NoMore") }} -[[ - [" +#2 Citation +# Dans un block div [[ ... ]] (classe CSS mydiv), +# La citation entre [" ... "] (classe CSS mycite) +# est placée dans un paragraphe (classe CSS mycite) +# ! Tout commentaire "# ..." dans la citation sera affiché... +[[ mydiv + [" mycite ;; A great quote here ! cite: Someone date: 2023-10-13 book: A History - lang: EN + lang: en link: https://... - (( + (( mycite Here, i am )) "] ]] + + +# Créer une liste ol/ul entre <: ... :> (classe mylist) +# dans un paragraphe (classe du domaine) +# "+" pour ol, "=" pour ul +# Ajouter toujours un signe pour un sous-item ou /!\ au changement de signe +#2 Une liste mixée {_
        ,
          _} +(( + <: mylist + + numeric o: item 1 + ++ numeric ol sub-Item 1 + +++ numeric ol sub-sub-item 1 + ==== ul item >_top: Go to Top_< + ==== ul item >_top: Another anchor_< + :> +)) + ``` diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 797857c..8d98d3f 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Version: 1.9.27 +# Version: 1.9.28 # Updated: 2023-10-18 1697613100 # Tyto - Littérateur diff --git a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc index a374e7b8975c072826c472da0f4ab6e1a4af968f..fb65a91529337b6ac5dd6cd91beaa6fe18465162 100644 GIT binary patch delta 7512 zcma)B3vg4{nZEbx>g|_oNq*pm{K6IijENuA2{^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szM{{IKi#vsH1 diff --git a/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc index 653ea4908d0901a9fc3b643286034ee39260f084..fefee3c709cca2ce33f9055c5d4b201ba29b4f7b 100644 GIT binary patch delta 2442 zcma)6ZA@EL7(VCTwv^J_PfA-pO2^0AP7BO|unsm?7@3)hjx8~FAGPdUp@R)_d-stF zX`TClOBdPB6q0QQvxp?dWU+tt$Cyoj8%Qu|s_6V!B5|5)G=^YeJm<2)Een}9x$k|S z_j%v*KIiM^4&CDYA90)kkmtL*yM)gg0r-i6{9}CN{5i*5@&BC^8W3>jIe;7lm#MIm zV3!KJ2`*RR3W6(DxQbwp3RlN;d?SgedI;qN=X)ecYoU?^R80grsH%xjO|Ytou%U_I zAx)Y#jIrK=b||b@NyO)&Ik`hEZ%rDla|k=s$_ltL!sVwya@D@zB%Dfd0p}u|dWp&o zuCJHij%oR3RKvHRT2zPX(N^R`H8-^Uv&hf4q5$89w(&dBQ+xjXQ60Mu zk!BQLhc{Wmv`g#BtJxskt&XX(LAn<=8Jaw!AYL!o*XvFyCz@hZMD)z*o%?i1kC+)9 z5l`OLXN*BiFOZyhOtOm$rw0pI3DB7}6b7GA!q5`S#uEIivoaa?ZX(%$N~ATBMAYWe z)$6+1XvR%Ovp>EPZv3yoi3eB*t}Hg;xe|*-T0d=o?g5Ulo=2p~g}4L>Ma>0CM3O4W z+-5;Ka>h(AC?-m& zAQ6}XvL4iJonz}$9TOc{b7^Yl1HJKb??mm}rnE^0W=$AQ`4_G3$*QYWSE{d7rv?^n z<&%w98>j2$ZN3GYPX=637$#Rg<8@g}sSKdOnYEXVcilHy-s!p2bF*{a=v^>+WxyC5 zSy$!w^I2o*eWODLT021B#QW{=(Jy3;jRyLW=9dhnzKxq?d) z4YHQ1UDdp5|4{V*rC4=*Gk@9dd*Q_DiP zsU;<3IotT*2dsYF@n-wQ_Eh^KtG`?|&pH=a=N#)K=!pdWhV$WXx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jUL&^@v9VHjpT&}RWTwrsV z>>`!J+62_~VDeU}J|j@jfek7Gi51m@2mufQ3hZATHo5sJr8%i~MXf+CBM=w6PcD`2 h6#O8-#wh%O0ZvFvmXPV<=V0XfzyK#yCU2CH0RUn^lRE$a diff --git a/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc index 0d13eaa9547cd8f54677af78af641f471ae93c27..1687e02a03ace147afa5a2c1d65410c10681a7aa 100644 GIT binary patch delta 1770 zcmZuxU2GIp6yAI1XJ==2b~?LT*mk$N{In=ajR_H~rL+8&?Q&-j zLheM2@qt*A!g(>NB*a9}-~&mC_Cb9T5q+^*6&nd^d_jGnF}@f`Ja={r_2+Kx*>lc( z=iGD8Irsd!_4{q+CDYVHxJJHRTYmklSzSPdR9_nYOSu2=;GVsbP*@SqF8pc_LVV&& zoH){v0M6Py1vciA&_Fs;oLoek%fc>LzC7B+iDyD*ycw#*B0J$UX(I&QBdmS3B3w~xuzHP(^D#*AaUwST=MDY7o3h0hj3|}oEP%fUVP4ZD0DbF$8(v}x-Io0 zb6P~0bG)NCs@DQ<(G7T)pJ@lNAR!GU;zJ{q7t72WIOrW69&isGsJL)kDp+*5GNT8& zeM2Ko87@g1^(^}8#O-##tkkbv*)?T#OT*ic9jbE?aqGcNGCC;z8w53$g6%h;5FnUzV67r;mz}K_yO-n z1DuJt7;X!9gKv9bOn62gqkFg43I?~7HiJ0IT*)AzZuxJq5~ELGvFxB&XH<(g;D?(? z6eiR*q_@=;xEjs`Tr>O@el+40LL}r!z6r;|OHe-*ZkE|59)tU8IuQHJ*chp#>aZ9T zH38eHwLmVCk)lo*eo|BDs?)G4AJtJ7+|~;CO@pVkG)xCLEx;Li$sDSq8g_>&dtrr^ zMSrsqJaz-OAs-RP&PMt+*_B8gXd_TMDeVrOAY*iNbG@75wQfR9AGcZ7(YYP;ox;s3 zaSXhXueZEpW9P-Vfz&!5_6^>^6sLhV1W1)zOm}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-U7k%{+1ruF{z{;n>h1Q4)_-Bn exinjNmCnFt?eE0iC8X|8VUJ`Y7zamW&iDrtRe;U_ diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 7f30735..187e152 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -70,20 +70,20 @@ def manage(action, target): # Check article(S) # # Also used with multiple (loop) # #--------------------------------# -def is_article(target): - if not valid(target): +def is_article(target): + if not valid(target) or post.error != 0: if targets: return else: sys.exit(post.error) # When all is OK # Will create post database, but now, show some values print("Final texts string") - """ + for ln, line in enumerate(texts, post.head_lines + 1): print(">", ln, line) print() - """ + # Write to post database cf_update_values("after") @@ -104,6 +104,36 @@ def valid(target): post.error = debug.out(210, post.chk_date, post.uri, True, 0, False) return False + # Reset: must be done only when multiple targets + if targets: + post.title = ("title:", False) + post.about = ("about:", False) + post.date = ("date:", False) + post.tags = ("tags:", False) + post.author = ("author:", False) + post.logo = ("logo:", False) # optional + + post.stats_bcodes = 0 + post.stats_quotes = 0 + post.stats_parags = 0 + post.stats_lists = 0 + post.stats_divs = 0 + + post.stats_links = 0 + post.stats_images = 0 + post.stats_files = 0 + post.stats_raws = 0 + post.stats_codes = 0 + post.stats_abbrs = 0 + + post.stats_text_links = 0 + post.stats_text_files = 0 + post.stats_text_images = 0 + post.stats_text_abbrs = 0 + post.stats_text_codes = 0 + post.stats_text_raws = 0 + post.error = 0 + # Reset post database (Old values are prepared) tools.create_file(post.cf_uri, post.ini_template) post.cf_load() @@ -168,6 +198,8 @@ def valid(target): post.error == 0 and sl_ptags(post.ptags[4]) \ or tools.exit(targets, post.error) + post.error > 0 and tools.exit(targets, post.error) + return True @@ -192,6 +224,7 @@ def ol_tags(): stats_total_files = 0 sitemap = "True" stats_tyto_head_coms = 0 + for ln, line in enumerate(headers, 1): # Optional one line markers @@ -215,24 +248,24 @@ def ol_tags(): # =========================== elif not post.title[1] and line.startswith(post.title[0]): post.title = (post.title[0], ol_tag_value(line, False)) - if not is_ol_tag(post.title[0], post.title[1]): + if not is_ol_tag(post.title[0], post.title[1]): return False - post.cf_set("HEADERS", "title", post.title[1]) + post.cf_set("HEADERS", "title", post.title[1]) elif not post.about[1] and line.startswith(post.about[0]): post.about = (post.about[0], ol_tag_value(line, False)) - if not is_ol_tag(post.about[0], post.about[1]): + if not is_ol_tag(post.about[0], post.about[1]): return False - post.cf_set("HEADERS", "about", post.about[1]) + post.cf_set("HEADERS", "about", post.about[1]) elif not post.date[1] and line.startswith(post.date[0]): post.date = (post.date[0], ol_tag_value(line, False)) - if not is_ol_tag(post.date[0], post.date[1]): + if not is_ol_tag(post.date[0], post.date[1]): return False elif not is_valid_date(post.date[1]): return False post.date = ("date:", tools.local_date(post.date[1])) - post.cf_set("HEADERS", "date", post.date[1]) + post.cf_set("HEADERS", "date", post.date[1]) elif not post.author[1] and line.startswith(post.author[0]): post.author = (post.author[0], ol_tag_value(line, True)) @@ -242,9 +275,9 @@ def ol_tags(): elif not post.tags[1] and line.startswith(post.tags[0]): post.tags = (post.tags[0], ol_tag_value(line, True)) - if not is_ol_tag(post.tags[0], post.tags[1]): + if not is_ol_tag(post.tags[0], post.tags[1]): return False - post.cf_set("HEADERS", "tags", post.tags[1]) + post.cf_set("HEADERS", "tags", post.tags[1]) # Default domain logo for this post if not post.logo[1]: @@ -568,6 +601,9 @@ def sl_ptags(markers): ), post.uri, True, 2, False) return False continue + csstest = tools.get_css(line, markers[0], ln) + if post.error > 0: + return index0 = line.index(markers[0][0]) tag_ln = ln content = line @@ -578,8 +614,8 @@ def sl_ptags(markers): if line.lstrip().startswith(markers[1]): if index0 < 0: post.error = \ - debug.out(53, '%s: %s) %s...'%( - markers[2], ln, markers[0] + debug.out(53, '%s) %s: %s...'%( + ln, markers[2], markers[0] ), post.uri, True, 2, False) return False index1 = line.index(markers[1][0]) @@ -607,7 +643,7 @@ def sl_ptags(markers): markers[2].upper(), "html_%s"%post.ptags_stats[markers[2]], tools.b64_convert("encode", - convert[markers[2]](content) + convert[markers[2]](content, ln) ) ) @@ -619,29 +655,28 @@ def sl_ptags(markers): # ---------------------- if index1 >= 0 and index0 < 0: post.error = \ - debug.out(53, '%s: %s) %s...'%( - markers[2], tag_ln, markers[0] + debug.out(53, '%s) %s: %s...'%( + tag_ln, markers[2], markers[0] ), post.uri, True,2, False) return False if index0 >= 0 and index1 < 0: post.error = \ - debug.out(53, '%s: %s) ...%s'%( - markers[2], tag_ln, markers[1] + debug.out(53, '%s) %s: ...%s'%( + tag_ln, markers[2], markers[1] ), post.uri, True,2, False) return False if index0 != index1: post.error = \ - debug.out(53, '%s: %s) %s...%s'%( - markers[2], tag_ln, markers[0], markers[1] + debug.out(53, '%s) %s: %s...%s'%( + tag_ln, markers[2], markers[0], markers[1] ), post.uri, True,2, False) return False return True - #==========================================# # icodes (SAME LINE) # # Check if opened and closed markers match # @@ -697,8 +732,13 @@ def icodes(): for icode in icodes: stats_text_icodes += 1 - icnew = markers[0][4] + icode + markers[0][5] - line = line.replace(icnew, "") + icnew = markers[0][4] + \ + tools.convert_html_signs(icode) + \ + markers[0][5] + icrep = markers[0][4] + \ + icode + \ + markers[0][5] + line = line.replace(icrep, "") # Set HTML [ICODES] to post database html_val = icnew.replace(markers[0][4], markers[0][2]%css) @@ -720,8 +760,13 @@ def icodes(): for icode in icodes: stats_text_icodes += 1 - icnew = markers[1][4] + icode + markers[1][5] - line = line.replace(icnew, "") + icnew = markers[1][4] + \ + tools.convert_html_signs(icode) + \ + markers[1][5] + icrep = markers[1][4] + \ + icode + \ + markers[1][5] + line = line.replace(icrep, "") # Set HTML [ICODES] to post database html_val = icnew.replace(markers[1][4], markers[1][2]%css) @@ -761,7 +806,7 @@ def sl_stags(): for ln, line in enumerate(texts, post.head_lines + 1): linels = line.lstrip() - # legacy Tyto Titles + # Tyto Titles if linels.startswith(post.tyto_titles): if not linels[3:]: post.error = \ @@ -831,11 +876,19 @@ def sl_stags(): post.title[1], post.title[1], "%%s" ) ) + + # BR line + elif line.lstrip().startswith(post.html_brline[0]): + brcss = tools.get_css(line, post.html_brline[0], ln) + + # HR line + elif line.lstrip().startswith(post.html_hrline[0]): + hrcss = tools.get_css(line, post.html_hrline[0], ln) # Anchor source elif line.lstrip().startswith(post.anchor_target[0]): - anchor_id = tools.get_css(line, post.anchor_target[0]) + anchor_id = tools.get_css(line, post.anchor_target[0], ln) if anchor_id in anchors_ids: post_error = \ debug.out(54, '%s) "%s"'%(ln, anchor_id), post.uri, True, 2, False) diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 6f1fe6d..01a758b 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -99,16 +99,36 @@ def is_tyto_format(): global head_lines, text_lines, lines head_contents = text_contents = "" + separator = False with open(uri, "r") as contents: contents = contents.read() - try: - head_contents = contents.rsplit(sep)[0] - text_contents = contents.rsplit(sep)[1] - except: - error = debug.out(21, sep, uri, True, 2, False) - return False + for line in contents.rsplit("\n"): + if not line: + line = " " + + if line.startswith(sep): + separator = True + continue + + if separator: + if not text_contents: text_contents = line + else: text_contents = "%s\n%s"%(text_contents, line) + else: + if not head_contents: head_contents = line + else: head_contents = "%s\n%s"%(head_contents, line) + + + if not separator: + error = debug.out(21, sep, uri, True, 2, False) + return False + print("===") + print(head_contents) + print("===") + print(text_contents) + print("===") + if not head_contents: error = debug.out(22, "?", uri, True, 2, False) return False @@ -118,7 +138,7 @@ def is_tyto_format(): return False lines = len(contents.splitlines()) - head_lines = len(head_contents.splitlines()) + head_lines = len(head_contents.splitlines()) + 1 # Count with sep line text_lines = len(text_contents.splitlines()) return True @@ -301,31 +321,38 @@ nositemap = "! NoSitemap" # Article will not be included in sitemap # One Line needed sep = "-----" # Splitter between header and article texts -# Will replace "Fals" with title value +# Will replace "Fals" with data value title = ("title:", False) about = ("about:", False) date = ("date:", False) tags = ("tags:", False) author = ("author:", False) -logo = ("logo:", False) # optional +logo = ("logo:", False) # optional # Multiple lines (3) markers -ml_tags = ("link:", "image:", "file:", "raw:", "code:", "abbr:") +ml_tags = ( + "link:", + "image:", + "file:", + "raw:", + "code:", + "abbr:" + ) ml_tags_marks = { - "link:" : "__", - "file:" : "--", - "image:" : "_image:", - "abbr:" : "::", - "raw:" : "_raw:", - "code:" : "_code:" + ml_tags[0] : "__", + ml_tags[2] : "--", + ml_tags[1] : "_image:", + ml_tags[5] : "::", + ml_tags[3] : "_raw:", + ml_tags[4] : "_code:" } ml_tags_stats = { - "link:" : stats_links, - "file:" : stats_files, - "image:" : stats_images, - "abbr:" : stats_abbrs, - "raw:" : stats_raws, - "code:" : stats_codes, + ml_tags[0] : stats_links, + ml_tags[2] : stats_files, + ml_tags[1] : stats_images, + ml_tags[5] : stats_abbrs, + ml_tags[3] : stats_raws, + ml_tags[4] : stats_codes, } # Markers with uri in value2 @@ -344,11 +371,11 @@ ptags = ( ) ptags_stats = { - "bcodes" : stats_bcodes, - "quotes" : stats_quotes, - "parags" : stats_parags, - "lists" : stats_lists, - "divs" : stats_divs, + ptags[0][2] : stats_bcodes, + ptags[1][2] : stats_quotes, + ptags[2][2] : stats_parags, + ptags[3][2] : stats_lists, + ptags[4][2] : stats_divs, } # Tyto Titles #1 =

          diff --git a/src/var/lib/tyto/program/tools.py b/src/var/lib/tyto/program/tools.py index 34b9843..517755e 100644 --- a/src/var/lib/tyto/program/tools.py +++ b/src/var/lib/tyto/program/tools.py @@ -36,6 +36,8 @@ from hashlib import blake2b import sys, os, configparser, datetime, time, base64 import debug, domain, post +import post + #=========================================# # Write to post database, error was found # @@ -46,10 +48,11 @@ def exit(targets, error): post.cf_set("CHECK", "errors", "True") post.cf_write() - if targets: return + if targets: + return sys.exit(error) - + #==============================# # Set and return date and time # @@ -192,7 +195,7 @@ def b64_convert(action, content): def convert_html_signs(string): string = string.replace('<', '<') string = string.replace('>', '>') - astring = string.replace('"', '"') + string = string.replace('"', '"') string = string.replace("'", ''') return string @@ -203,13 +206,15 @@ def convert_html_signs(string): # Only take the first name # # Exit all process if _... # #--------------------------# -def get_css(line, mark): +def get_css(line, mark, ln): css = line.rsplit(mark)[1].lstrip().rsplit(" ")[0] css = css or domain.css # Tyto use _abc as markers if css.startswith("_"): - debug.out(56, "'_...' (CSS: %s)"%css, post.uri, True, 2, True) + post.error = \ + debug.out(56, '%s) CSS: "%s"'%(ln, css), post.uri, True, 2, False) + return "NameError" return css diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index a3bb5e5..f4751ed 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -46,13 +46,13 @@ import tyto, tools, post, domain # Create HTML bcode # # convert raw lines # #-------------------# -def bcode(lines): +def bcode(lines, ln): lines = lines.rsplit("\n") html_bcode = "" for ln, line in enumerate(lines): if ln == 0: # Opened marker - css = tools.get_css(line, post.ptags[0][0]) + css = tools.get_css(line, post.ptags[0][0], ln) continue if ln == len(lines) - 1: # Closed marker @@ -65,7 +65,7 @@ def bcode(lines): if ln == 1: fc = len(line) - len(line.lstrip()) - line = tyto.code_line%(ln, line[fc:]) + line = tyto.code_line%(ln, tools.convert_html_signs(line[fc:])) if not html_bcode: html_bcode = line else: html_bcode = "%s\n%s"%(html_bcode, line) @@ -80,7 +80,7 @@ def bcode(lines): # Create HTML quote # # convert raw lines # #-------------------# -def quote(lines): +def quote(lines, ln): lines = lines.rsplit("\n") # Template html_quote = "" @@ -98,7 +98,7 @@ def quote(lines): # Open Marker (Unused in HTML). Get user CSS class if ln == 0: - css = tools.get_css(line, post.ptags[1][0]) + css = tools.get_css(line, post.ptags[1][0], ln) continue # Closed marker (Unused in HTML) @@ -140,8 +140,13 @@ def quote(lines): blockquote_lang = ' lang="%s"'%lang #