Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
a11829e5
Commit
a11829e5
authored
May 06, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore file/URL paths in same check
parent
5fc26584
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
trans/checks/same.py
trans/checks/same.py
+4
-0
trans/tests/same_checks.py
trans/tests/same_checks.py
+18
-0
No files found.
trans/checks/same.py
View file @
a11829e5
...
...
@@ -215,6 +215,7 @@ DOMAIN_RE = re.compile(
re.IGNORECASE
)
PATH_RE = re.compile(r'
(
/
[
a
-
zA
-
Z0
-
9
=
:
?
.
_
-
]
+
)
+
')
class SameCheck(TargetCheck):
'''
...
...
@@ -260,6 +261,9 @@ class SameCheck(TargetCheck):
# Strip domain names/URLs
stripped = DOMAIN_RE.sub('', stripped)
# Strip file/URL paths
stripped = PATH_RE.sub('', stripped)
# Remove some html entities
stripped = stripped.replace(
'
&
nbsp
;
', '
'
...
...
trans/tests/same_checks.py
View file @
a11829e5
...
...
@@ -199,3 +199,21 @@ class SameCheckTest(CheckTestCase):
''
)
)
def
test_same_path
(
self
):
self
.
do_test
(
False
,
(
'/cgi-bin/koha/catalogue/search.pl?q='
,
'/cgi-bin/koha/catalogue/search.pl?q='
,
''
)
)
self
.
do_test
(
True
,
(
'File/directory'
,
'File/directory'
,
''
)
)
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