Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pycomsdk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
com
pycomsdk
Commits
e3d05036
Commit
e3d05036
authored
Nov 20, 2019
by
Savva Golubitsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strings now split better
parent
9dbdc092
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
12 deletions
+10
-12
parser.cpython-37.pyc
comsdk/__pycache__/parser.cpython-37.pyc
+0
-0
parser.py
comsdk/parser.py
+8
-10
main.py
main.py
+1
-1
test.adot
test.adot
+1
-1
No files found.
comsdk/__pycache__/parser.cpython-37.pyc
View file @
e3d05036
No preview for this file type
comsdk/parser.py
View file @
e3d05036
...
...
@@ -131,8 +131,8 @@ class Parser():
first
=
True
for
s
in
param
.
__slots__
:
attr
=
getattr
(
param
,
s
)
if
attr
is
not
None
and
u'u2713
'
in
attr
:
vals
=
attr
.
split
(
u'u2713
'
)
if
attr
is
not
None
and
'
\0
'
in
attr
:
vals
=
attr
.
split
(
'
\0
'
)
for
v
in
vals
:
par
=
copy
.
copy
(
param
)
setattr
(
par
,
s
,
v
)
...
...
@@ -144,12 +144,11 @@ class Parser():
parm
=
Params
()
props
=
props
.
replace
(
"]"
,
''
)
if
'('
in
props
:
#replaces , in (smth,smth) to
matches
=
re
.
search
(
r"\((\w+,)+\w+\)"
,
props
)
print
(
matches
)
# for m in matches:
# print(matches)
props
=
props
[:
props
.
find
(
'('
)]
+
props
[
props
.
find
(
'('
)
+
1
:
props
.
find
(
')'
)]
.
replace
(
','
,
u'u2713'
)
mchs
=
[
m
for
m
in
re
.
finditer
(
r'\((\w+,)*\w+\)'
,
props
)]
for
m
in
mchs
:
props
=
props
[:
m
.
span
()[
0
]]
+
(
props
[
m
.
span
()[
0
]:
m
.
span
()[
1
]])
.
replace
(
','
,
'
\0
'
)
+
props
[
m
.
span
()[
1
]:]
props
=
props
.
replace
(
"("
,
""
)
props
=
props
.
replace
(
")"
,
""
)
rs
=
props
.
split
(
r","
)
#.split(r", ")
for
r
in
rs
:
r
=
r
.
split
(
r"="
,
1
)
...
...
@@ -158,6 +157,7 @@ class Parser():
else
:
print
(
"
\t
ERROR:Unknown parameter: "
+
r
[
0
])
exit
(
-
1
)
print
(
parm
)
return
parm
def
_param_from_entln
(
self
,
raw
):
...
...
@@ -169,8 +169,6 @@ class Parser():
spl
=
list
(
filter
(
lambda
x
:
x
!=
"["
and
x
!=
"]"
and
x
!=
""
,
spl
))
left
=
spl
[
0
]
.
split
(
","
)
right
=
spl
[
2
]
.
split
(
","
)
if
len
(
spl
)
>
3
:
self
.
_param_from_props
(
spl
[
3
])
if
(
len
(
left
)
>
1
)
and
(
len
(
right
)
>
1
):
print
(
"ERROR:Ambigious multiple connection in line:
\n\t
{}"
.
format
(
raw
))
exit
()
...
...
main.py
View file @
e3d05036
import
comsdk.parser
as
prs
from
comsdk.graph
import
Selector
,
Func
p
=
5
p
=
5
res
=
lambda
:
[
True
for
i
in
range
(
p
)]
print
(
res
())
...
...
test.adot
View file @
e3d05036
...
...
@@ -38,5 +38,5 @@ digraph CODEOBJECT_GENERATOR
// В зависимости от результата вычисления функции-SELECTOR осуществляется переход по
//первому или второму ребру
RESULT_SAVED, DUMP_CREATED -> __END__ [morphism=(EDGE_8, EDGE_9)]
RESULT_SAVED -> INPUT_READY,FAKE,__END__ [selector=SELECTOR, morphism=(EDGE_6,EDGE_1,EDGE_7),order=(10,20,30)]
RESULT_SAVED -> INPUT_READY,FAKE,__END__ [selector=SELECTOR, morphism=(EDGE_6,EDGE_1,EDGE_7),
order=(10,20,30)]
}
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