Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
076c896a
Commit
076c896a
authored
Oct 12, 2018
by
Paul McCarthy
🚵
Browse files
RF: Raw strings for regexps
parent
e6a4d1f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
fsl/data/dicom.py
View file @
076c896a
...
...
@@ -120,11 +120,11 @@ def enabled():
cmd
=
'dcm2niix -h'
versionPattern
=
re
.
compile
(
r
'v'
'(?P<major>[0-9]+)\.'
'(?P<minor>[0-9]+)\.'
'(?P<year>[0-9]{4})'
'(?P<month>[0-9]{2})'
'(?P<day>[0-9]{2})'
)
r
'(?P<major>[0-9]+)\.'
r
'(?P<minor>[0-9]+)\.'
r
'(?P<year>[0-9]{4})'
r
'(?P<month>[0-9]{2})'
r
'(?P<day>[0-9]{2})'
)
try
:
output
=
sp
.
check_output
(
cmd
.
split
()).
decode
()
...
...
fsl/data/dtifit.py
View file @
076c896a
...
...
@@ -50,7 +50,7 @@ def getDTIFitDataPrefix(path):
# Gather all of the existing file
# prefixes into a dictionary of
# prefix : [file list] mappings.
pattern
=
'^(.*)_(?:V1|V2|V3|L1|L2|L3).*$'
pattern
=
r
'^(.*)_(?:V1|V2|V3|L1|L2|L3).*$'
prefixes
=
{}
for
f
in
[
f
for
flist
in
files
for
f
in
flist
]:
...
...
fsl/version.py
View file @
076c896a
...
...
@@ -130,7 +130,7 @@ def patchVersion(filename, newversion):
with
open
(
filename
,
'rt'
)
as
f
:
lines
=
f
.
readlines
()
pattern
=
re
.
compile
(
'^__version__ *= *
\'
.*
\'
*$'
)
pattern
=
re
.
compile
(
r
'^__version__ *= *\'.*\' *$'
)
for
i
,
line
in
enumerate
(
lines
):
if
pattern
.
match
(
line
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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