123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828 |
- <?xml version="1.0" encoding="utf-8"?>
- <!-- Created by Leo: http://leoeditor.com/leo_toc.html -->
- <leo_file xmlns:leo="http://leoeditor.com/namespaces/leo-python-editor/1.1" >
- <leo_header file_format="2"/>
- <globals/>
- <preferences/>
- <find_panel_settings/>
- <vnodes>
- <v t="caminhante.20200313155940.1"><vh>@settings</vh>
- <v t="caminhante.20200313155940.3"><vh>@data abbreviations</vh></v>
- <v t="caminhante.20200313155940.4"><vh>@outline-data tree-abbreviations</vh></v>
- <v t="caminhante.20200618180759.1"><vh>@command terminal-here @key=Alt-T</vh></v>
- <v t="caminhante.20200619162742.1"><vh>@command open-url-here @key=Ctrl-U</vh></v>
- <v t="caminhante.20200313155940.99"><vh>nodeActions</vh>
- <v t="caminhante.20200604232050.1"><vh>@cmd *</vh></v>
- <v t="caminhante.20200619161501.1"><vh>@download *</vh></v>
- <v t="caminhante.20200619155412.1"><vh>@duck *</vh></v>
- <v t="caminhante.20211214151759.1"><vh>@files Makefile</vh></v>
- <v t="caminhante.20200927204806.1"><vh>@gcc|@gcc .* [X]</vh></v>
- <v t="caminhante.20200808174417.1"><vh>@js|@js .* [X]</vh></v>
- <v t="knoppix.20200918114306.1"><vh>@kml *</vh></v>
- <v t="knoppix.20200918115239.1"><vh>@kmlfolder *</vh></v>
- <v t="knoppix.20200918115703.1"><vh>@latlon *</vh></v>
- <v t="knoppix.20200918120617.1"><vh>@latlonh *</vh></v>
- <v t="caminhante.20200912185313.1"><vh>@lua|@lua .* [X]</vh></v>
- <v t="caminhante.20210430163831.1"><vh>@mkdir *</vh></v>
- <v t="caminhante.20210430170244.1"><vh>@mv file://*</vh></v>
- <v t="caminhante.20200619213937.1"><vh>@node|@node .* [X]</vh></v>
- <v t="caminhante.20210608171556.1"><vh>@odt *</vh></v>
- <v t="caminhante.20210905232208.1"><vh>@rm *</vh></v>
- <v t="caminhante.20210430164404.1"><vh>@rmdir /*/</vh></v>
- <v t="caminhante.20200618203115.1"><vh>@run|@run .* [X]</vh></v>
- <v t="caminhante.20200619154823.1"><vh>@web *</vh></v>
- </v>
- </v>
- <v t="caminhante.20211214150936.2"><vh>XForth</vh>
- <v t="caminhante.20211214151142.1"><vh>@path .</vh>
- <v t="caminhante.20211215232241.3"><vh>.gitmodules</vh></v>
- <v t="caminhante.20211214151146.9"><vh>/.git/</vh></v>
- <v t="caminhante.20211215232241.2"><vh>/meta/</vh></v>
- <v t="caminhante.20211216004210.1"><vh>/XForth</vh>
- <v t="caminhante.20211214153326.1"><vh>Arithmetic tests</vh>
- <v t="caminhante.20211214153355.1"><vh>*LT*</vh></v>
- <v t="caminhante.20211214153401.1"><vh>*GT*</vh></v>
- <v t="caminhante.20211214153407.1"><vh>*LE*</vh></v>
- <v t="caminhante.20211214153411.1"><vh>*GE*</vh></v>
- <v t="caminhante.20211214153418.1"><vh>*EQU0*</vh></v>
- <v t="caminhante.20211214153424.1"><vh>*DIF0*</vh></v>
- <v t="caminhante.20211214153429.1"><vh>*LT0*</vh></v>
- <v t="caminhante.20211214153434.1"><vh>*GT0*</vh></v>
- <v t="caminhante.20211214153439.1"><vh>*LE0*</vh></v>
- <v t="caminhante.20211214153444.1"><vh>*GE0*</vh></v>
- <v t="caminhante.20211214153451.1"><vh>*AND4*</vh></v>
- <v t="caminhante.20211214153456.1"><vh>*OR4*</vh></v>
- <v t="caminhante.20211214153500.1"><vh>*NOT4*</vh></v>
- <v t="caminhante.20211214153505.1"><vh>*NEG4*</vh></v>
- </v>
- <v t="caminhante.20211214153126.1"><vh>Basic arithmetic</vh>
- <v t="caminhante.20211214153135.1"><vh>*INCR1*</vh></v>
- <v t="caminhante.20211214153142.1"><vh>*DECR1*</vh></v>
- <v t="caminhante.20211214153150.1"><vh>*INCR4*</vh></v>
- <v t="caminhante.20211214153208.1"><vh>*DECR4*</vh></v>
- <v t="caminhante.20211214153214.1"><vh>*ADDIT*</vh></v>
- <v t="caminhante.20211214153220.1"><vh>*SUBIT*</vh></v>
- <v t="caminhante.20211214153229.1"><vh>*MULIT*</vh></v>
- <v t="caminhante.20211214153247.1"><vh>*DIVMOD*</vh></v>
- </v>
- <v t="caminhante.20211214153530.1"><vh>Memory operations</vh>
- <v t="caminhante.20211216004240.1"><vh>*POKE4*</vh></v>
- <v t="caminhante.20211216004245.1"><vh>*PEEK4*</vh></v>
- <v t="caminhante.20211216004250.1"><vh>*POKE4ADD*</vh></v>
- <v t="caminhante.20211216004256.1"><vh>*POKE4SUB*</vh></v>
- <v t="caminhante.20211216004300.1"><vh>*POKE1*</vh></v>
- <v t="caminhante.20211216004304.1"><vh>*PEEK1*</vh></v>
- <v t="caminhante.20211216004309.1"><vh>*COPY1*</vh></v>
- <v t="caminhante.20211216004314.1"><vh>*COPY4*</vh></v>
- <v t="caminhante.20211216004321.1"><vh>*MOVE1*</vh></v>
- </v>
- </v>
- <v t="caminhante.20211214151146.7"><vh>@clean Makefile</vh></v>
- <v t="caminhante.20211215234432.1"><vh>@edit .gitignore</vh></v>
- <v t="caminhante.20211215232259.1"><vh>@edit forth-compiler.meta</vh></v>
- <v t="caminhante.20211216001625.1"><vh>@edit ithread.inc</vh></v>
- <v t="caminhante.20211214151146.8"><vh>@edit LICENSE</vh></v>
- <v t="caminhante.20211215234815.2"><vh>@edit test.asm</vh></v>
- <v t="caminhante.20211215234815.1"><vh>@edit test.fth</vh></v>
- <v t="caminhante.20211216003644.1"><vh>@edit xforth.asm</vh></v>
- <v t="caminhante.20211214151146.6"><vh>@file primitives.asm</vh></v>
- <v t="caminhante.20211216002840.1"><vh>@file xforth.fth</vh></v>
- <v t="caminhante.20211215233815.3"><vh>forth-compiler</vh></v>
- <v t="caminhante.20211215232839.1"><vh>proc32.inc</vh></v>
- <v t="caminhante.20211216001602.3"><vh>structs.inc</vh></v>
- <v t="caminhante.20211216001602.2"><vh>structs_v.inc</vh></v>
- <v t="caminhante.20211216001602.1"><vh>symbols.inc</vh></v>
- <v t="caminhante.20211214151146.1"><vh>xforth.leo</vh></v>
- </v>
- </v>
- </vnodes>
- <tnodes>
- <t tx="caminhante.20200313155940.1"></t>
- <t tx="caminhante.20200313155940.3">@tabwidth -2
- </t>
- <t tx="caminhante.20200313155940.4"></t>
- <t tx="caminhante.20200313155940.99">@language python
- </t>
- <t tx="caminhante.20200604232050.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- if c.isChanged(): c.save()
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- command = ''.join(c.p.h.split('@cmd ')[1:])
- command = "cat <<'EOFEOFEOFEOFEOFEOF' | bash\n"+command+'\nEOFEOFEOFEOFEOFEOF'
- g.es(c.p.h)
- c.p.b += execute(command)
- c.save()
- </t>
- <t tx="caminhante.20200618180759.1">@language python
- import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- if c.isChanged(): c.save()
- path = c.getNodePath(c.p)
- execute('x-terminal-emulator --working-directory="'+path+'"')
- </t>
- <t tx="caminhante.20200618203115.1">@language python
- import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- w = c.frame.body.wrapper
- s1,s2 = w.getSelectionRange()
- if s1 == s2:
- code = c.p.b
- else:
- linebr = c.p.b.find('\n',s2)
- if linebr == -1: linebr = len(c.p.b)
- code = c.p.b[s1:s2]
- g.es(c.p.h)
- command = "cat <<'EOFEOFEOFEOFEOFEOF' | bash\n"+code+'\nEOFEOFEOFEOFEOFEOF'
- cpc = c.p.copy()
- novoNo = cpc.insertAsLastChild()
- novoNo.h = c.p.h
- novoNo.b = execute(command)
- c.redraw()
- c.save()
- w.setSelectionRange(s1,s2)
- </t>
- <t tx="caminhante.20200619154823.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- if c.isChanged(): c.save()
- url = ''.join(c.p.h.split('@web ')[1:])
- command = 'lynx -image_links -dump "'+url+'"'
- g.es(c.p.h)
- c.p.b = execute(command)
- c.save()
- </t>
- <t tx="caminhante.20200619155412.1">import subprocess
- import urllib.parse
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- if c.isChanged(): c.save()
- search = ''.join(c.p.h.split('@duck ')[1:])
- searchenc = urllib.parse.quote(search)
- command = 'lynx -dump "https://duckduckgo.com/html/?q='+searchenc+'&t=seamonkey"'
- g.es(c.p.h)
- c.p.b = execute(command)
- c.save()
- </t>
- <t tx="caminhante.20200619161501.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- if c.isChanged(): c.save()
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- url = ''.join(c.p.h.split('@download ')[1:])
- command = 'wget --no-config --continue --no-verbose --adjust-extension --tries=3 --content-on-error "'+url+'"'
- g.es(c.p.h)
- c.p.b += execute(command)
- c.save()
- </t>
- <t tx="caminhante.20200619162742.1">@language python
- w = c.frame.body.wrapper
- b = c.p.b
- i,j = w.getSelectionRange()
- selecao = b[i:j]
- cpc = c.p.copy()
- novoNo = cpc.insertAsLastChild()
- c.setHeadString(novoNo, '@web '+selecao)
- c.selectPosition(novoNo)
- c.redraw()
- </t>
- <t tx="caminhante.20200619213937.1">import subprocess
- import re
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- code = re.sub(r'^#|\n+#', '\n///', g.getScript(c,c.p))
- g.es(c.p.h)
- command = "cat <<'EOFEOFEOFEOFEOFEOF' | node\n"+code+'\nEOFEOFEOFEOFEOFEOF'
- c.p.b += '\n' + execute(command)
- </t>
- <t tx="caminhante.20200808174417.1">import subprocess
- import re
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- code = re.sub(r'^#|\n+#', '\n///', g.getScript(c,c.p))
- g.es(c.p.h)
- command = "cat <<'EOFEOFEOFEOFEOFEOF' | js\n"+code+'\nEOFEOFEOFEOFEOFEOF'
- c.p.b += '\n' + execute(command)
- </t>
- <t tx="caminhante.20200912185313.1">import subprocess
- import re
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- code = re.sub(r'^#|\n+#', '\n---', g.getScript(c,c.p))
- g.es(c.p.h)
- command = "cat <<'EOFEOFEOFEOFEOFEOF' | lua\n"+code+'\nEOFEOFEOFEOFEOFEOF'
- c.p.b += '\n' + execute(command)
- </t>
- <t tx="caminhante.20200927204806.1">import subprocess
- import re
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- code = re.sub(r'^#@|\n+#@', '\n///', g.getScript(c,c.p))
- args = ''.join(c.p.h.split('@gcc ')[1:])
- g.es(c.p.h)
- command = "cat <<'EOFEOFEOFEOFEOFEOF' | gcc -Wall -Werror -std=gnu11 -x c - -o t && ./t "+args+"\n"+code+'\nEOFEOFEOFEOFEOFEOF'
- c.p.b += '\n' + execute(command)
- </t>
- <t tx="caminhante.20210430163831.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- path = ''.join(c.p.h.split('@mkdir ')[1:])
- cmd = 'mkdir -p "' + path + '"'
- g.es(c.p.h)
- execute(cmd)
- c.p.h = '/'+path+'/'
- c.p.b = '@path ' + path</t>
- <t tx="caminhante.20210430164404.1">import subprocess
- import shutil
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- ps = c.p.parents()
- for par in ps:
- break
- path = c.getNodePath(par)
- g.os.chdir(path)
- path = ''.join(c.p.h.split('@rmdir /')[1:]).split('/')[0]
- shutil.rmtree(path)</t>
- <t tx="caminhante.20210430170244.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- path = ''.join(c.p.h.split('@mv file://')[1:])
- cmd = 'mv -v "' + path + '" ./'
- g.es(c.p.h)
- g.es(execute(cmd))</t>
- <t tx="caminhante.20210608171556.1">import subprocess
- import re
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- def writeFile (_file,_content):
- f = open(_file, "w")
- f.write(_content)
- f.close()
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- docName = ''.join(c.p.h.split('@odt ')[1:])
- docPath = './.odt/'+docName+'/'
- manifest_xml = """<?xml version="1.0" encoding="UTF-8"?>
- <manifest:manifest
- xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2"
- xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0">
- <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.text"/>
- <manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>
- <manifest:file-entry manifest:full-path="meta.xml" manifest:media-type="text/xml"/>
- <manifest:file-entry manifest:full-path="manifest.rdf" manifest:media-type="application/rdf+xml"/>
- <manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>
- </manifest:manifest>
- """
- mimetype = "application/vnd.oasis.opendocument.text"
- content_xml = (
- """<?xml version="1.0" encoding="UTF-8"?>
- <office:document-content
- xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
- xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
- xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
- xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
- xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
- xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
- xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
- xmlns:math="http://www.w3.org/1998/Math/MathML"
- xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
- xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
- xmlns:ooo="http://openoffice.org/2004/office"
- xmlns:ooow="http://openoffice.org/2004/writer"
- xmlns:oooc="http://openoffice.org/2004/calc"
- xmlns:dom="http://www.w3.org/2001/xml-events"
- xmlns:xforms="http://www.w3.org/2002/xforms"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:rpt="http://openoffice.org/2005/report"
- xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
- xmlns:xhtml="http://www.w3.org/1999/xhtml"
- xmlns:grddl="http://www.w3.org/2003/g/data-view#"
- xmlns:officeooo="http://openoffice.org/2009/office"
- xmlns:tableooo="http://openoffice.org/2009/table"
- xmlns:drawooo="http://openoffice.org/2010/draw"
- xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
- xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
- xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
- xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
- xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2">
- <office:body>
- <office:text>
- """,
- re.sub(r'^#@[^\n]+|\n+#@[^\n]+', '', g.getScript(c,c.p)),
- """
- </office:text>
- </office:body>
- </office:document-content>
- """
- )
- manifest_rdf = """<?xml version="1.0" encoding="utf-8"?>
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about="styles.xml">
- <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#StylesFile"/>
- </rdf:Description>
- <rdf:Description rdf:about="">
- <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="styles.xml"/>
- </rdf:Description>
- <rdf:Description rdf:about="content.xml">
- <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#ContentFile"/>
- </rdf:Description>
- <rdf:Description rdf:about="">
- <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="content.xml"/>
- </rdf:Description>
- <rdf:Description rdf:about="">
- <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#Document"/>
- </rdf:Description>
- </rdf:RDF>
- """
- meta_xml = f"""<?xml version="1.0" encoding="UTF-8"?>
- <office:document-meta
- xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
- xmlns:ooo="http://openoffice.org/2004/office"
- xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.2">
- <office:meta>
- <meta:generator>LeoEditor/6.4$Linux_x64</meta:generator>
- <dc:title>{docName}</dc:title>
- </office:meta>
- </office:document-meta>
- """
- generate_odt = f"""cp -f styles.xml '{docPath}/styles.xml'; cd '{docPath}'; zip -q9ru doc.odt META-INF manifest.rdf meta.xml content.xml styles.xml mimetype"""
- generate_pdf = f"""libreoffice --headless --convert-to pdf '{docPath}/doc.odt' && mv 'doc.pdf' '{docName}.pdf'"""
- execute('mkdir -p "'+docPath+'/META-INF/"')
- writeFile(docPath+'/META-INF/manifest.xml', manifest_xml)
- writeFile(docPath+'/mimetype', mimetype)
- writeFile(docPath+'/content.xml',''.join(content_xml))
- writeFile(docPath+'/manifest.rdf', manifest_rdf)
- writeFile(docPath+'/meta.xml', meta_xml)
- # writeFile(docPath+'/styles.xml', styles_xml)
- execute(generate_odt)
- g.es(execute(generate_pdf))
- </t>
- <t tx="caminhante.20210905232208.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- filename = ''.join(c.p.h.split('@rm ')[1:])
- cmd = 'rm -vf "' + filename + '"'
- g.es(c.p.h)
- g.es(execute(cmd))
- </t>
- <t tx="caminhante.20211214150936.2"></t>
- <t tx="caminhante.20211214151142.1">@tabwidth -2</t>
- <t tx="caminhante.20211214151146.1"></t>
- <t tx="caminhante.20211214151146.7">@tabwidth 4
- CFLAGS := -std=gnu99 -Wall -Werror -Wno-unused-function -Wfatal-errors -D_GNU_SOURCE -flto -Os
- all: forth-compiler xforth
- %: %.asm $(wildcard *.inc)
- `which fasm` "$<"
- %.asm: %.fth forth-compiler
- ./forth-compiler "$<" "$@"
- forth-compiler: forth-compiler.c
- %.c: %.meta
- ./meta/meta "$<" "$@"
- clean:
- rm xforth *.c
- </t>
- <t tx="caminhante.20211214151146.9">@path .git</t>
- <t tx="caminhante.20211214151759.1">import subprocess
- def execute (cmd):
- return subprocess.run(cmd,shell=True,universal_newlines=True,stderr=subprocess.STDOUT,stdout=subprocess.PIPE).stdout
- if c.isChanged(): c.save()
- path = c.getNodePath(c.p)
- g.os.chdir(path)
- g.es(execute('make'))</t>
- <t tx="caminhante.20211214153126.1"></t>
- <t tx="caminhante.20211214153135.1">INCR1: dd _enter_native
- inc dword [esp]
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153142.1">DECR1: dd _enter_native
- dec dword [esp]
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153150.1">INCR4: dd _enter_native
- add dword [esp], 4
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153208.1">DECR4: dd _enter_native
- sub dword [esp], 4
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153214.1">ADDIT: dd _enter_native
- pop eax
- add dword [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153220.1">SUBIT: dd _enter_native
- pop eax
- sub dword [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153229.1">MULIT: dd _enter_native
- pop eax
- pop ebx
- imul ebx, eax
- push eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153247.1">DIVMOD: dd _enter_native
- xor edx, edx
- pop ebx
- pop eax
- idiv ebx
- push edx
- push eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153326.1"></t>
- <t tx="caminhante.20211214153355.1">LT: dd _enter_native
- pop eax
- cmp eax, [esp]
- setl al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153401.1">GT: dd _enter_native
- pop eax
- cmp eax, [esp]
- setg al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153407.1">LE: dd _enter_native
- pop eax
- cmp eax, [esp]
- setle al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153411.1">GE: dd _enter_native
- pop eax
- cmp eax, [esp]
- setge al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153418.1">EQU0: dd _enter_native
- cmp dword [esp], 0
- setz al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153424.1">DIF0: dd _enter_native
- cmp dword [esp], 0
- setnz al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153429.1">LT0: dd _enter_native
- cmp dword [esp], 0
- setl al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153434.1">GT0: dd _enter_native
- cmp dword [esp], 0
- setg al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153439.1">LE0: dd _enter_native
- cmp dword [esp], 0
- setle al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153444.1">GE0: dd _enter_native
- cmp dword [esp], 0
- setge al
- movzx eax, al
- mov [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153451.1">AND4: dd _enter_native
- pop eax
- and [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153456.1">OR4: dd _enter_native
- pop eax
- or [esp], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153500.1">NOT4: dd _enter_native
- not dword [esp]
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153505.1">NEG4: dd _enter_native
- neg dword [esp]
- jmp _next_routine
- </t>
- <t tx="caminhante.20211214153530.1"></t>
- <t tx="caminhante.20211215232241.2">@path meta</t>
- <t tx="caminhante.20211215232241.3"></t>
- <t tx="caminhante.20211215232839.1"></t>
- <t tx="caminhante.20211215233815.3"></t>
- <t tx="caminhante.20211216001602.1"></t>
- <t tx="caminhante.20211216001602.2"></t>
- <t tx="caminhante.20211216001602.3"></t>
- <t tx="caminhante.20211216004210.1"></t>
- <t tx="caminhante.20211216004240.1">POKE4: dd _enter_native
- pop ebx
- pop eax
- mov [ebx], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004245.1">PEEK4: dd _enter_native
- pop ebx
- mov eax, [ebx]
- push eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004250.1">POKE4ADD: dd _enter_native
- pop ebx
- pop eax
- add [ebx], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004256.1">POKE4SUB: dd _enter_native
- pop ebx
- pop eax
- sub [ebx], eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004300.1">POKE1: dd _enter_native
- pop ebx
- pop eax
- mov [ebx], al
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004304.1">PEEK1: dd _enter_native
- pop ebx
- xor eax, eax
- mov al, [ebx]
- push eax
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004309.1">COPY1: dd _enter_native
- mov ebx, [esp+4]
- mov edx, [esp]
- mov al, [ebx]
- mov [edx], al
- inc dword [esp]
- inc dword [esp+4]
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004314.1">COPY4: dd _enter_native
- mov ebx, [esp+4]
- mov edx, [esp]
- mov eax, [ebx]
- mov [edx], eax
- add dword [esp], 4
- add dword [esp+4], 4
- jmp _next_routine
- </t>
- <t tx="caminhante.20211216004321.1">MOVE1: dd _enter_native
- cld
- pop ecx
- mov edx, ecx
- shr ecx, 2
- and edx, 3
- pop edi
- pop esi
- rep movsd
- mov ecx, edx
- rep movsb
- jmp _next_routine
- </t>
- <t tx="knoppix.20200918114306.1">nome = ''.join(c.p.h.split('@kml ')[1:])
- c.p.h = f"@file {nome}.kml"
- c.p.b = f"""@language xml
- ##@tabwidth -2
- <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
- <Document>
- <name>{nome}</name>
- <Style id="poi">
- <IconStyle>
- <Icon>
- <href>/usr/share/marble/data/bitmaps/annotation.png</href>
- <scale>0.5</scale>
- </Icon>
- </IconStyle>
- <BalloonStyle>
- <bgColor>ffffaabb</bgColor>
- <text>$[description]</text>
- </BalloonStyle>
- </Style>
- ##@others
- </Document>
- </kml>""".replace("##","")
- </t>
- <t tx="knoppix.20200918115239.1">nome = ''.join(c.p.h.split('@kmlfolder ')[1:])
- c.p.b = f"""@language xml
- <Folder>
- <name>{nome}</name>
- ##@others
- </Folder>""".replace("##","")
- </t>
- <t tx="knoppix.20200918115703.1">import re
- a = c.p.h
- b = re.match(r'^@latlon\s+(-?\d+(\.\d+)?)\s*,\s*(-?\d+(\.\d+)?)\s*(.*)$',a)
- title = (lambda: b.groups()[4] if b else a)()
- lat = (lambda: b.groups()[0] if b else '<|latitude|>')()
- lon = (lambda: b.groups()[2] if b else '<|longitude|>')()
- c.p.b = f"""@language xml
- <Placemark>
- <name>{title}</name>
- <description><![CDATA[
- ##@others
- ]]></description>
- <LookAt>
- <longitude>{lon}</longitude>
- <latitude>{lat}</latitude>
- <altitude>0.0000000000</altitude>
- <range>100</range>
- </LookAt>
- <styleUrl>#poi</styleUrl>
- <Point>
- <coordinates> {lon},{lat} </coordinates>
- </Point>
- </Placemark>""".replace("##","")
- </t>
- <t tx="knoppix.20200918120617.1">import re
- a = c.p.h
- b = re.match(r'^@latlonh\s+(-?\d+(\.\d+)?)\s*,\s*(-?\d+(\.\d+)?)\s*(.*)$',a)
- title = (lambda: b.groups()[4] if b else a)()
- lat = (lambda: b.groups()[0] if b else '<|latitude|>')()
- lon = (lambda: b.groups()[2] if b else '<|longitude|>')()
- try:
- lt=float(lat)
- ln=float(lon)
- nslat=(lambda: 'N'+lat if lt>0 else 'S'+lat[1:])()
- welon=(lambda: 'E'+lon if ln>0 else 'W'+lon[1:])()
- c.p.b = f"""@language xml
- <Placemark>
- <name>{title}</name>
- <description><![CDATA[
- <html><body>
- <pre style="white-space:pre-line;">
- ##@others
- </pre>
- <p><a href="https://wego.here.com/directions/mix/{nslat},{welon}?map={lat},{lon},15,normal" target="_blank">Abrir no HERE Maps</a></p>
- </body></html>
- ]]></description>
- <LookAt>
- <longitude>{lon}</longitude>
- <latitude>{lat}</latitude>
- <altitude>0.0000000000</altitude>
- <range>100</range>
- </LookAt>
- <styleUrl>#poi</styleUrl>
- <iconUrl>imovel.png</iconUrl>
- <Point>
- <coordinates>{lon},{lat}</coordinates>
- </Point>
- </Placemark>""".replace("##","")
- except:
- c.p.b = f"""title: {title}
- lat: {lat}
- lon: {lon}
- """
- </t>
- </tnodes>
- </leo_file>
|