123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <?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.20210124200516.2"><vh>API de mailing list</vh></v>
- <v t="caminhante.20200313155940.1"><vh>@settings</vh>
- <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.2"><vh>command mk_path_image_nodes</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.20200619213937.1"><vh>@node|@node .* [X]</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="caminhante.20200912185313.1"><vh>@lua|@lua .* [X]</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.20210214143542.1"><vh>@run status</vh>
- <v t="caminhante.20210214143548.1"><vh>@run status</vh></v>
- </v>
- <v t="caminhante.20210214144036.1"><vh>@path include</vh>
- <v t="caminhante.20210214143558.1"><vh>@file server.js</vh></v>
- </v>
- </vnodes>
- <tnodes>
- <t tx="caminhante.20200313155940.1"></t>
- <t tx="caminhante.20200313155940.2">@language python
- @tabwidth -2
- import os
- image_extensions = ('.png','.jpg','.jpeg')
- web_prefixes = ('http:','https:')
- if c.p.b.startswith('@path') or c.p.h.startswith('@path'):
- for child in c.p.children():
- firstline = child.b.split('\n')[0]
- headline = child.h
- for a in web_prefixes:
- if a in firstline:
- firstline = firstline.split('?')[0]
- break
- if a in headline:
- headline = headline.split('?')[0]
- break
- fnb, extb = os.path.splitext(firstline)
- fnh, exth = os.path.splitext(headline)
- if extb in image_extensions or exth in image_extensions:
- if not firstline:
- child.b = child.h
- child.h = '@image ' + child.h
- </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('terminator --working-directory="'+path+'" --new-tab')
- </t>
- <t tx="caminhante.20200618203115.1">@language python
- import subprocess
- # def getpath (p):
- # dict = c.scanAllDirectives(p)
- # d = dict.get("path")
- # if p.isAnyAtFileNode():
- # filename = p.anyAtFileNodeName()
- # filename = g.os_path_join(d,filename)
- # if filename:
- # d = g.os_path_dirname(filename)
- # if d is None:
- # return ""
- # else:
- # return g.os_path_normpath(d)
- # if c.isChanged(): c.save()
- 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'
- # if s1 == s2:
- # c.p.b += '\n' + execute(command)
- # else:
- # c.p.b = c.p.b[0:linebr] + '\n' + execute(command) + c.p.b[linebr:]
- 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
- # if c.isChanged(): c.save()
- 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 -x c - -o t && ./t "+args+"\n"+code+'\nEOFEOFEOFEOFEOFEOF'
- c.p.b += '\n' + execute(command)
- </t>
- <t tx="caminhante.20210124200516.2"></t>
- <t tx="caminhante.20210214143542.1">git status</t>
- <t tx="caminhante.20210214143548.1">On branch master
- Your branch is up to date with 'origin/master'.
- Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
- new file: a.leo
- </t>
- <t tx="caminhante.20210214144036.1">@tabwidth -2</t>
- </tnodes>
- </leo_file>
|