Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OBITools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
24
Issues
24
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools
Commits
d4702ff2
Commit
d4702ff2
authored
Oct 21, 2014
by
Frédéric Boyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] order in location
parent
3e10b14a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
__init__.py
src/obitools/location/__init__.py
+9
-0
No files found.
src/obitools/location/__init__.py
View file @
d4702ff2
...
...
@@ -368,6 +368,12 @@ class CompositeLocation(Location):
def
__str__
(
self
):
return
"join(
%
s)"
%
','
.
join
([
str
(
x
)
for
x
in
self
.
_locs
])
class
CompositeLocationOrder
(
CompositeLocation
):
def
__str__
(
self
):
return
"order(
%
s)"
%
','
.
join
([
str
(
x
)
for
x
in
self
.
_locs
])
class
ComplementLocation
(
Location
):
"""
...
...
@@ -477,6 +483,9 @@ def __locationParser(text):
if
text
[
0
:
5
]
==
'join('
:
assert
text
[
-
1
]
==
')'
,
"Misformated location :
%
s"
%
text
return
CompositeLocation
(
__locationParser
(
sl
)
for
sl
in
__sublocationIterator
(
text
[
5
:
-
1
]))
if
text
[
0
:
6
]
==
'order('
:
assert
text
[
-
1
]
==
')'
,
"Misformated location :
%
s"
%
text
return
CompositeLocationOrder
(
__locationParser
(
sl
)
for
sl
in
__sublocationIterator
(
text
[
6
:
-
1
]))
elif
text
[
0
:
11
]
==
'complement('
:
assert
text
[
-
1
]
==
')'
,
"Misformated location :
%
s"
%
text
subl
=
tuple
(
__locationParser
(
sl
)
for
sl
in
__sublocationIterator
(
text
[
11
:
-
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