Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Redner Odoo Module
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Redner Odoo Module
Commits
45782562e45b
Commit
45782562e45b
authored
1 month ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
mypy
parent
a1a7bf16e7d6
No related branches found
No related tags found
1 merge request
!82
✨ Compatibility with changes in converter 18.0.4.0.0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
converter.py
+1
-1
1 addition, 1 deletion
converter.py
doc/autotodo.py
+20
-9
20 additions, 9 deletions
doc/autotodo.py
redner.py
+1
-1
1 addition, 1 deletion
redner.py
with
22 additions
and
11 deletions
converter.py
+
1
−
1
View file @
45782562
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
from
typing
import
Any
from
typing
import
Any
from
odoo
import
models
# type: ignore[import-untyped]
from
odoo
import
models
# type: ignore[import-untyped]
from
odoo.addons.converter
import
Converter
# type: ignore[import-untyped]
from
odoo.addons.converter
import
Converter
from
odoo.tools.mimetypes
import
guess_mimetype
# type: ignore[import-untyped]
from
odoo.tools.mimetypes
import
guess_mimetype
# type: ignore[import-untyped]
...
...
This diff is collapsed.
Click to expand it.
doc/autotodo.py
+
20
−
9
View file @
45782562
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
import
os
import
os
import
os.path
import
os.path
import
sys
import
sys
from
collections.abc
import
Mapping
from
collections.abc
import
Mutable
Mapping
def
main
():
def
main
():
...
@@ -31,13 +31,13 @@
...
@@ -31,13 +31,13 @@
sys
.
exit
(
1
)
sys
.
exit
(
1
)
folder
=
sys
.
argv
[
1
]
folder
=
sys
.
argv
[
1
]
exts
=
sys
.
argv
[
2
].
split
(
"
,
"
)
exts
:
list
[
str
]
=
sys
.
argv
[
2
].
split
(
"
,
"
)
tags
=
sys
.
argv
[
3
].
split
(
"
,
"
)
tags
:
list
[
str
]
=
sys
.
argv
[
3
].
split
(
"
,
"
)
todolist
=
{
tag
:
[]
for
tag
in
tags
}
todolist
:
dict
[
str
,
list
[
tuple
[
str
,
int
,
str
]]]
=
{
tag
:
[]
for
tag
in
tags
}
path_file_length
:
Mapping
[
str
,
int
]
=
{}
path_file_length
:
Mutable
Mapping
[
str
,
int
]
=
{}
for
root
,
_dirs
,
files
in
os
.
walk
(
folder
):
for
root
,
_dirs
,
files
in
os
.
walk
(
folder
):
scan_folder
((
exts
,
tags
,
todolist
,
path_file_length
),
root
,
files
)
scan_folder
((
exts
,
tags
,
todolist
,
path_file_length
),
root
,
files
)
create_autotodo
(
folder
,
todolist
,
path_file_length
)
create_autotodo
(
folder
,
todolist
,
path_file_length
)
...
@@ -38,10 +38,10 @@
...
@@ -38,10 +38,10 @@
for
root
,
_dirs
,
files
in
os
.
walk
(
folder
):
for
root
,
_dirs
,
files
in
os
.
walk
(
folder
):
scan_folder
((
exts
,
tags
,
todolist
,
path_file_length
),
root
,
files
)
scan_folder
((
exts
,
tags
,
todolist
,
path_file_length
),
root
,
files
)
create_autotodo
(
folder
,
todolist
,
path_file_length
)
create_autotodo
(
folder
,
todolist
,
path_file_length
)
def
write_info
(
f
,
infos
,
folder
,
path_file_length
:
Mapping
[
str
,
int
]):
def
write_info
(
f
,
infos
,
folder
,
path_file_length
:
Mutable
Mapping
[
str
,
int
]):
# Check sphinx version for lineno-start support
# Check sphinx version for lineno-start support
import
sphinx
import
sphinx
...
@@ -78,10 +78,10 @@
...
@@ -78,10 +78,10 @@
f
.
write
(
"
\n
"
)
f
.
write
(
"
\n
"
)
def
create_autotodo
(
folder
,
todolist
,
path_file_length
:
Mapping
[
str
,
int
]):
def
create_autotodo
(
folder
,
todolist
,
path_file_length
:
Mutable
Mapping
[
str
,
int
]):
with
open
(
"
autotodo
"
,
"
w+
"
)
as
f
:
with
open
(
"
autotodo
"
,
"
w+
"
)
as
f
:
for
tag
,
info
in
list
(
todolist
.
items
()):
for
tag
,
info
in
list
(
todolist
.
items
()):
f
.
write
(
"
{}
\n
{}
\n\n
"
.
format
(
tag
,
"
=
"
*
len
(
tag
)))
f
.
write
(
"
{}
\n
{}
\n\n
"
.
format
(
tag
,
"
=
"
*
len
(
tag
)))
write_info
(
f
,
info
,
folder
,
path_file_length
)
write_info
(
f
,
info
,
folder
,
path_file_length
)
...
@@ -82,10 +82,19 @@
...
@@ -82,10 +82,19 @@
with
open
(
"
autotodo
"
,
"
w+
"
)
as
f
:
with
open
(
"
autotodo
"
,
"
w+
"
)
as
f
:
for
tag
,
info
in
list
(
todolist
.
items
()):
for
tag
,
info
in
list
(
todolist
.
items
()):
f
.
write
(
"
{}
\n
{}
\n\n
"
.
format
(
tag
,
"
=
"
*
len
(
tag
)))
f
.
write
(
"
{}
\n
{}
\n\n
"
.
format
(
tag
,
"
=
"
*
len
(
tag
)))
write_info
(
f
,
info
,
folder
,
path_file_length
)
write_info
(
f
,
info
,
folder
,
path_file_length
)
def
scan_folder
(
data_tuple
,
dirname
,
names
):
def
scan_folder
(
data_tuple
:
tuple
[
list
[
str
],
list
[
str
],
dict
[
str
,
list
[
tuple
[
str
,
int
,
str
]]],
MutableMapping
[
str
,
int
],
],
dirname
:
str
,
names
:
list
[
str
],
):
(
exts
,
tags
,
res
,
path_file_length
)
=
data_tuple
(
exts
,
tags
,
res
,
path_file_length
)
=
data_tuple
for
name
in
names
:
for
name
in
names
:
(
root
,
ext
)
=
os
.
path
.
splitext
(
name
)
(
root
,
ext
)
=
os
.
path
.
splitext
(
name
)
...
@@ -98,7 +107,9 @@
...
@@ -98,7 +107,9 @@
res
[
tag
].
extend
(
info
)
res
[
tag
].
extend
(
info
)
def
scan_file
(
filename
,
tags
)
->
tuple
[
dict
[
str
,
list
[
tuple
[
str
,
int
,
str
]]],
int
]:
def
scan_file
(
filename
:
str
,
tags
:
list
[
str
]
)
->
tuple
[
dict
[
str
,
list
[
tuple
[
str
,
int
,
str
]]],
int
]:
res
:
dict
[
str
,
list
[
tuple
[
str
,
int
,
str
]]]
=
{
tag
:
[]
for
tag
in
tags
}
res
:
dict
[
str
,
list
[
tuple
[
str
,
int
,
str
]]]
=
{
tag
:
[]
for
tag
in
tags
}
line_num
:
int
=
0
line_num
:
int
=
0
with
open
(
filename
)
as
f
:
with
open
(
filename
)
as
f
:
...
...
This diff is collapsed.
Click to expand it.
redner.py
+
1
−
1
View file @
45782562
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
from
urllib.parse
import
quote
from
urllib.parse
import
quote
import
requests
import
requests
import
requests_unixsocket
import
requests_unixsocket
# type: ignore[import-untyped]
from
odoo
import
_
# type: ignore[import-untyped]
from
odoo
import
_
# type: ignore[import-untyped]
from
odoo.exceptions
import
ValidationError
# type: ignore[import-untyped]
from
odoo.exceptions
import
ValidationError
# type: ignore[import-untyped]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment