Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Franck Pommereau
/
snakes
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Franck Pommereau
2023-10-02 13:40:53 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
74f655df70fb68c4f33e1af29a568f3d3fe08bbe
74f655df
1 parent
6f590641
fixes from Carlos Galindo
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
snakes/lang/astpy25.py
snakes/utils/simul/httpd.py
snakes/utils/simul/logger.py
snakes/lang/astpy25.py
View file @
74f655d
...
...
@@ -16,10 +16,10 @@ for name, cls in inspect.getmembers(_ast, inspect.isclass) :
class
_Ast
(
cls
,
AST
)
:
def
__init__
(
self
,
*
larg
,
**
karg
)
:
if
len
(
larg
)
>
0
and
len
(
larg
)
!=
len
(
self
.
_fields
)
:
raise
TypeError
,
(
"
%
s constructor takes either 0 or "
"
%
u positional arguments"
%
(
self
.
__class__
.
__name__
,
len
(
self
.
_fields
)))
raise
TypeError
(
"
%
s constructor takes either 0 or "
"
%
u positional arguments"
%
(
self
.
__class__
.
__name__
,
len
(
self
.
_fields
)))
for
name
,
arg
in
zip
(
self
.
_fields
,
larg
)
+
karg
.
items
()
:
if
name
in
self
.
_fields
:
setattr
(
self
,
name
,
arg
)
...
...
snakes/utils/simul/httpd.py
View file @
74f655d
...
...
@@ -16,7 +16,10 @@ except :
try
:
import
BaseHTTPServer
except
:
import
http
as
BaseHTTPServer
try
:
import
http.server
as
BaseHTTPServer
except
:
import
http
as
BaseHTTPServer
##
##
...
...
snakes/utils/simul/logger.py
View file @
74f655d
...
...
@@ -133,8 +133,8 @@ class TerminalController:
# For any modern terminal, we should be able to just ignore
# these, so strip them out.
import
curses
cap
=
curses
.
tigetstr
(
cap_name
)
or
''
return
re
.
sub
(
r
'\$<\d+>[/*]?'
,
''
,
cap
)
cap
=
curses
.
tigetstr
(
cap_name
)
or
b
''
return
re
.
sub
(
r
b
'
\
$<
\
d+>[/*]?'
,
b
''
,
cap
)
def
render
(
self
,
template
):
"""
...
...
Please
register
or
login
to post a comment