Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Romain Casati
Basthon Kernel
Commits
ad137039
Commit
ad137039
authored
Feb 01, 2021
by
Romain Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better string formating.
parent
5c85172f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
8 deletions
+6
-8
setup/basthon-kernel/__main__.py
setup/basthon-kernel/__main__.py
+1
-2
src/basthon-py/basthon/_hack_modules.py
src/basthon-py/basthon/_hack_modules.py
+1
-1
src/modules/requests/requests/__init__.py
src/modules/requests/requests/__init__.py
+1
-2
src/modules/turtle/turtle/svg.py
src/modules/turtle/turtle/svg.py
+1
-1
www/pelicanconf.py
www/pelicanconf.py
+2
-2
No files found.
setup/basthon-kernel/__main__.py
View file @
ad137039
...
...
@@ -19,8 +19,7 @@ def main():
args
=
parser
.
parse_args
()
if
args
.
install
:
print
(
'Installing Basthon kernel {} in current directory'
.
format
(
implementation
))
print
(
f
'Installing Basthon kernel
{
implementation
}
in current directory'
)
data_path
=
Path
(
__file__
).
parent
/
'data'
...
...
src/basthon-py/basthon/_hack_modules.py
View file @
ad137039
...
...
@@ -67,7 +67,7 @@ def hack_sympy():
"""
latex
=
sep
.
join
(
sympy
.
latex
(
expr
)
for
expr
in
args
)
kernel
.
display_event
({
"display_type"
:
"sympy"
,
"content"
:
"$${
}$$"
.
format
(
latex
)
})
"content"
:
f
"$$
{
latex
}
$$"
})
sympy
.
pretty_print
=
pretty_print
...
...
src/modules/requests/requests/__init__.py
View file @
ad137039
...
...
@@ -69,8 +69,7 @@ def request(method, url, **kwargs):
""" See requests.request """
# url params
if
"params"
in
kwargs
:
url
+=
"?"
+
"&"
.
join
((
"{}={}"
.
format
(
k
,
v
)
for
k
,
v
in
kwargs
[
"params"
].
items
()))
url
+=
"?"
+
"&"
.
join
((
f
"
{
k
}
=
{
v
}
"
for
k
,
v
in
kwargs
[
"params"
].
items
()))
req
=
js
.
eval
(
"var __basthon_req = new XMLHttpRequest(); __basthon_req"
)
# hack for using js try/catch (see below)
req
.
open
(
method
.
lower
(),
url
,
False
)
# synchronous request
req
.
overrideMimeType
(
'text/plain; charset=x-user-defined'
)
...
...
src/modules/turtle/turtle/svg.py
View file @
ad137039
...
...
@@ -60,7 +60,7 @@ def _tag_func(tag):
# Better use method bind of DOMNode objects
node
.
addEventListener
(
key
[
2
:],
value
)
elif
key
==
"style"
:
node
.
setAttribute
(
"style"
,
';'
.
join
(
"{}: {}"
.
format
(
k
,
v
)
node
.
setAttribute
(
"style"
,
';'
.
join
(
f
"
{
k
}
:
{
v
}
"
for
k
,
v
in
value
.
items
()))
elif
"href"
in
key
:
node
.
setAttributeNS
(
_xlink_ns
,
"href"
,
value
)
...
...
www/pelicanconf.py
View file @
ad137039
...
...
@@ -70,11 +70,11 @@ def galerie(*args):
domain
=
'console'
if
file
.
endswith
(
'.py'
)
else
'notebook'
url
=
f
"https://
{
domain
}
.basthon.fr/?from=
{
urllib
.
parse
.
quote
(
url
)
}
"
if
aux
is
not
None
:
url
+=
'
&aux={
}'
.
format
(
urllib
.
parse
.
quote
(
aux
)
)
url
+=
f
"
&aux=
{
urllib
.
parse
.
quote
(
aux
)
}
"
return
url
return
""
.
join
(
one_img
.
format
(
SITEURL
=
SITEURL
,
img_name
=
'{}.png'
.
format
(
Path
(
file
).
with_suffix
(
''
)
)
,
img_name
=
f
"
{
Path
(
file
).
with_suffix
(
''
)
}
.png"
,
description
=
data
[
'desc'
],
url
=
url
(
file
,
data
.
get
(
'aux'
)))
for
file
,
data
in
examples
.
items
())
...
...
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