Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lettuce
Overview
Overview
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
edx
lettuce
Commits
095c7541
Commit
095c7541
authored
Sep 07, 2012
by
Gabriel Falcao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring @jssevestre's pull request
parent
bcbe832f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
lettuce/core.py
+5
-14
No files found.
lettuce/core.py
View file @
095c7541
...
...
@@ -86,21 +86,12 @@ class Language(object):
return
'<Language "
%
s">'
%
self
.
code
def
__getattr__
(
self
,
attr
):
pattern
=
[
u'first_of_'
,
u'last_of'
]
for
pattern
in
[
ur'^first_of_'
,
ur'^last_of'
]:
if
re
.
match
(
pattern
,
attr
):
name
=
re
.
sub
(
pattern
,
u''
,
attr
)
return
unicode
(
getattr
(
self
,
name
,
u''
)
.
split
(
u"|"
)[
0
])
if
not
re
.
match
(
u"(.*)_of_(.*)"
,
attr
):
return
super
(
Language
,
self
)
.
__getattribute__
(
attr
)
elif
re
.
match
(
u'
%
s'
%
pattern
[
0
],
attr
):
name
=
re
.
sub
(
r'^first_of_'
,
u''
,
attr
)
return
unicode
(
getattr
(
self
,
name
,
u''
)
.
split
(
u"|"
)[
0
])
elif
re
.
match
(
u'
%
s'
%
pattern
[
1
],
attr
):
name
=
re
.
sub
(
r'^last_of_'
,
u''
,
attr
)
return
unicode
(
getattr
(
self
,
name
,
u''
)
.
split
(
u"|"
)[
-
1
])
else
:
# raise exception
pass
return
super
(
Language
,
self
)
.
__getattribute__
(
attr
)
@property
def
non_capturable_scenario_separator
(
self
):
...
...
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