Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kodex
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
kodex
Commits
e6987a74
Commit
e6987a74
authored
Sep 14, 2017
by
Yannick Chudy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ethercalc /decalcograph
parent
c39d2969
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
botapad.py
botapad.py
+7
-6
botapadapp.py
botapadapp.py
+13
-4
No files found.
botapad.py
View file @
e6987a74
...
...
@@ -51,6 +51,7 @@ def convert_url(url):
framapad expension auto add /export/txt
"""
re_ggdoc
=
"https?:
\
/
\
/docs.google.com/document/d/([0-9a-zA-Z
\
-_]+)/(edit)"
ggdoc
=
re
.
findall
(
re_ggdoc
,
url
)
if
len
(
ggdoc
)
:
...
...
@@ -66,16 +67,16 @@ def convert_url(url):
url
=
"https://
%
s.framapad.org/p/
%
s/export/txt"
%
(
frama
[
0
],
frama
[
1
])
return
url
#https://framacalc.org/uspaties
re_framacalc
=
"https?:
\
/
\
/
frama
calc.org/([0-9a-zA-Z
\
-_]+)([
\
.csv]+)?"
re_framacalc
=
"https?:
\
/
\
/
(?:frama|ether)
calc.org/([0-9a-zA-Z
\
-_]+)([
\
.csv]+)?"
frama
=
re
.
findall
(
re_framacalc
,
url
)
debug
(
"convert_url"
,
url
,
frama
)
if
len
(
frama
)
:
frama
=
[
r
for
r
in
frama
[
0
]
if
len
(
r
)]
if
len
(
frama
)
==
1
:
url
=
"https://framacalc.org/
%
s.csv"
%
(
frama
[
0
])
return
url
#
url = "https://framacalc.org/%s.csv" % (frama[0])
#url = "https://framacalc.org/%s.csv" % (frama[0])
return
"
%
s.csv"
%
url
return
url
...
...
@@ -102,8 +103,8 @@ class Botapad(object):
def
__init__
(
self
,
bot
,
gid
,
description
,
delete
=
False
):
# Bot creation & login
log
(
"
\n
* Locating graph
%
s @ padagraph
\n
"
%
(
gid
)
)
log
(
"
\n
* Locating graph
%
s @ padagraph
\n
"
%
(
gid
)
)
self
.
gid
=
gid
self
.
imports
=
set
()
...
...
botapadapp.py
View file @
e6987a74
...
...
@@ -211,8 +211,15 @@ def home():
return
render_template
(
'homepage.html'
,
**
kw
)
@
app
.
route
(
'/decalcograph/<string:gid>'
,
methods
=
[
'GET'
])
def
decalcograph
(
gid
):
padurl
=
"https://ethercalc.org/
%
s"
%
gid
graphurl
=
"/import/igraph.html?s=ethercalc&gid=
%
s&live=1&nofoot=1"
%
gid
return
render_template
(
'framagraph.html'
,
graphurl
=
graphurl
,
padurl
=
padurl
)
@
app
.
route
(
'/framagraph/<string:gid>'
,
methods
=
[
'GET'
])
def
live
(
gid
):
def
framagraph
(
gid
):
padurl
=
"https://annuel2.framapad.org/p/
%
s"
%
gid
graphurl
=
"/import/igraph.html?s=framapad&gid=
%
s&live=1&nofoot=1"
%
gid
...
...
@@ -230,9 +237,7 @@ def googledoc(gid=None):
return
render_template
(
'framagraph.html'
,
graphurl
=
graphurl
,
padurl
=
padurl
)
def
pad2pdg
(
gid
,
url
):
...
...
@@ -266,6 +271,7 @@ def import2pdg(repo='igraph', content=None):
return
botimport
(
'igraph'
,
'html'
)
def
botimport
(
repo
,
content_type
=
"html"
):
#raise ValueError(request)
...
...
@@ -304,6 +310,9 @@ def botimport(repo, content_type="html"):
elif
pad_source
==
"google"
:
padurl
=
"https://docs.google.com/document/d/
%
s/edit"
%
gid
elif
pad_source
==
"ethercalc"
:
padurl
=
"https://ethercalc.org/
%
s"
%
gid
if
gid
and
padurl
:
...
...
Write
Preview
Markdown
is supported
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