Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mentat Test 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
713
Mentat
Mentat Test 3
Commits
58bcc00c
Commit
58bcc00c
authored
4 years ago
by
Rajmund Hruška
Browse files
Options
Downloads
Patches
Plain Diff
Feature: Rename _CESNETDict to MentatDict. (Redmine issue: #6800)
parent
987c868c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/mentat/idea/internal.py
+11
-11
11 additions, 11 deletions
lib/mentat/idea/internal.py
lib/mentat/idea/jsondict.py
+3
-3
3 additions, 3 deletions
lib/mentat/idea/jsondict.py
with
14 additions
and
14 deletions
lib/mentat/idea/internal.py
+
11
−
11
View file @
58bcc00c
...
...
@@ -50,12 +50,12 @@ import pynspect.rules
import
pynspect.compilers
def
cesne
t_dict_typedef
(
flavour
,
list_flavour
,
errors_list
,
abuses_list
,
addon
=
None
):
def
menta
t_dict_typedef
(
flavour
,
list_flavour
,
errors_list
,
abuses_list
,
addon
=
None
):
"""
Typedef generator helper for easy usage of custom definitions at
multiple places.
"""
cesne
t_def
=
{
menta
t_def
=
{
"
InspectionErrors
"
:
{
"
description
"
:
"
List of event pecularities found during inspection
"
,
"
type
"
:
errors_list
...
...
@@ -94,17 +94,17 @@ def cesnet_dict_typedef(flavour, list_flavour, errors_list, abuses_list, addon=N
}
}
if
addon
is
not
None
:
cesne
t_def
.
update
(
addon
)
return
cesne
t_def
menta
t_def
.
update
(
addon
)
return
menta
t_def
class
CESNET
Dict
(
typedcols
.
TypedDict
):
# pylint: disable=locally-disabled,too-many-ancestors
class
Mentat
Dict
(
typedcols
.
TypedDict
):
# pylint: disable=locally-disabled,too-many-ancestors
"""
This type definition represents a custom subdictionary under key
*_Mentat*/*_CESNET* in message root dictionary.
"""
allow_unknown
=
True
typedef
=
cesne
t_dict_typedef
(
typedef
=
menta
t_dict_typedef
(
idea
.
lite
.
idea_types
,
idea
.
lite
.
idea_lists
,
typedcols
.
typed_list
(
"
InspectionErrorsList
"
,
str
),
...
...
@@ -112,7 +112,7 @@ class CESNETDict(typedcols.TypedDict): # pylint: disable=locally-disabled,too-m
)
def
internal_base_addon_typedef
(
flavour
,
list_flavour
,
cesne
t_dict
,
addon
=
None
):
# pylint: disable=locally-disabled,unused-argument
def
internal_base_addon_typedef
(
flavour
,
list_flavour
,
menta
t_dict
,
addon
=
None
):
# pylint: disable=locally-disabled,unused-argument
"""
Typedef generator helper for easy usage of custom definitions at
multiple places.
...
...
@@ -128,11 +128,11 @@ def internal_base_addon_typedef(flavour, list_flavour, cesnet_dict, addon=None):
},
"
_Mentat
"
:
{
"
description
"
:
"
Custom CESNET/Mentat abominations to IDEA definition
"
,
"
type
"
:
cesne
t_dict
"
type
"
:
menta
t_dict
},
"
_CESNET
"
:
{
"
description
"
:
"
Custom CESNET/Mentat abominations to IDEA definition
"
,
"
type
"
:
cesne
t_dict
"
type
"
:
menta
t_dict
}
}
if
addon
is
not
None
:
...
...
@@ -161,7 +161,7 @@ class Idea(idea.lite.Idea): # pylint: disable=locally-disabled,too-many-ancesto
internal_base_addon_typedef
(
idea
.
lite
.
idea_types
,
idea
.
lite
.
idea_lists
,
CESNET
Dict
Mentat
Dict
)
)
...
...
@@ -210,7 +210,7 @@ class Idea(idea.lite.Idea): # pylint: disable=locally-disabled,too-many-ancesto
:return: The value of _Mentat if present, otherwise the value of _CESNET if present.
If neither of those keys exist then empty dictionary is returned.
:rtype:
cesne
t_dict
:rtype:
menta
t_dict
"""
return
self
.
get
(
'
_Mentat
'
)
if
'
_Mentat
'
in
self
else
self
.
get
(
'
_CESNET
'
,
{})
...
...
This diff is collapsed.
Click to expand it.
lib/mentat/idea/jsondict.py
+
3
−
3
View file @
58bcc00c
...
...
@@ -166,12 +166,12 @@ class NodeDict(typedcols.TypedDict): # pylint: disable=locally-disabled,too-man
allow_unknown
=
True
typedef
=
idea
.
base
.
node_dict_typedef
(
json_idea_types
,
json_idea_lists
)
class
CESNET
Dict
(
typedcols
.
TypedDict
):
# pylint: disable=locally-disabled,too-many-ancestors
class
Mentat
Dict
(
typedcols
.
TypedDict
):
# pylint: disable=locally-disabled,too-many-ancestors
"""
Typed dictionary representing *_Mentat*/*_CESNET* substructure in IDEA message structure.
"""
allow_unknown
=
True
typedef
=
mentat
.
idea
.
internal
.
cesne
t_dict_typedef
(
typedef
=
mentat
.
idea
.
internal
.
menta
t_dict_typedef
(
json_idea_types
,
json_idea_lists
,
simplify
(
typedcols
.
typed_list
(
"
InspectionErrorsList
"
,
str
)),
...
...
@@ -187,7 +187,7 @@ class CESNETDict(typedcols.TypedDict): # pylint: disable=locally-disabled,too-m
json_idea_addon
=
mentat
.
idea
.
internal
.
internal_base_addon_typedef
(
# pylint: disable=locally-disabled,invalid-name
json_idea_types
,
json_idea_lists
,
simplify
(
CESNET
Dict
),
simplify
(
Mentat
Dict
),
)
...
...
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