Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asn1-value-editor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
asn1-value-editor
Commits
b4ec122e
Commit
b4ec122e
authored
Oct 30, 2019
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make code more python3-friendly
parent
a16bdca4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
asn1_value_editor/asn1_value_editor.py
asn1_value_editor/asn1_value_editor.py
+2
-2
asn1_value_editor/vn.py
asn1_value_editor/vn.py
+8
-3
No files found.
asn1_value_editor/asn1_value_editor.py
View file @
b4ec122e
...
...
@@ -29,7 +29,7 @@ try:
from
PySide.QtGui
import
*
from
PySide.QtUiTools
import
*
except
ImportError
as
err
:
print
'Pyside not found (package python-pyside missing)...'
+
str
(
err
)
print
(
'Pyside not found (package python-pyside missing)...'
+
str
(
err
)
)
import
vn
...
...
@@ -598,7 +598,7 @@ class asn1Editor(QTreeView):
ptr
=
getattr
(
ptr
,
"exist"
)
ptr
=
getattr
(
ptr
,
field_name
)
present
=
ptr
.
Get
()
print
field_name
,
present
,
isAlwaysPresent
,
isAlwaysPresent
#
print field_name, present, isAlwaysPresent, isAlwaysPresent
field_optionality
.
setCheckState
(
Qt
.
Checked
if
present
else
Qt
.
Unchecked
)
ptr
.
Reset
(
stateBefore
)
...
...
asn1_value_editor/vn.py
View file @
b4ec122e
...
...
@@ -67,7 +67,12 @@ INT = Combine(Optional(oneOf("+ -")) + (Word(srange("[1-9]"), nums)|Literal('0')
# a lowercase followed by a-zA-z and -
#LID = Word(string.lowercase, string.letters+string.digits+'-')
# Update MP 21/11/12: made it tolerant to uppercase for the first character
LID
=
Word
(
string
.
letters
,
string
.
letters
+
string
.
digits
+
'-'
)
try
:
LID
=
Word
(
string
.
letters
,
string
.
letters
+
string
.
digits
+
'-'
)
except
AttributeError
:
# python 3
LID
=
Word
(
string
.
ascii_letters
,
string
.
ascii_letters
+
string
.
digits
+
'-'
)
identifier
=
LID
.
setResultsName
(
'IDENTIFIER'
)
# Value reference is in practice used to identify enumerated values
...
...
@@ -164,7 +169,7 @@ def fromValueNotationToPySide(varName, string):
try
:
return
{
varName
:
value
.
parseString
(
string
,
True
)[
0
]}
except
ParseException
as
err
:
print
'[fromValueNotationToPySide] Parsing error:'
,
string
print
(
'[fromValueNotationToPySide] Parsing error:'
,
string
)
raise
...
...
@@ -324,4 +329,4 @@ if __name__ == '__main__':
''' Test application '''
import
sys
if
len
(
sys
.
argv
)
==
2
:
print
fromValueNotationToPySide
(
sys
.
argv
[
1
]
)
print
(
fromValueNotationToPySide
(
sys
.
argv
[
1
])
)
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