Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
5b03f95c
Commit
5b03f95c
authored
1 year ago
by
BO ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
tweaks
parent
3a8729c4
dev
main
No related merge requests found
Pipeline
#2309
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
csst_common/file.py
+5
-9
csst_common/file.py
with
5 additions
and
9 deletions
+5
-9
csst_common/file.py
+
5
-
9
View file @
5b03f95c
...
...
@@ -11,18 +11,14 @@ class File:
self
.
new_dir
=
new_dir
if
new_dir
is
not
None
else
self
.
dirname
def
replace_ext
(
self
,
new_ext
:
str
=
"
wht
.fits"
,
new_dir
:
Optional
[
str
]
=
None
self
,
new_ext
:
Optional
[
str
]
=
"
img
.fits"
,
new_dir
:
Optional
[
str
]
=
None
)
->
str
:
if
new_dir
is
None
:
new_dir
=
self
.
new_dir
if
new_ext
is
None
:
new_ext
=
self
.
ext
if
new_ext
.
startswith
(
"."
):
return
os
.
path
.
join
(
new_dir
if
new_dir
is
not
None
else
self
.
dirname
,
self
.
prefix
+
new_ext
,
)
return
os
.
path
.
join
(
new_dir
,
self
.
prefix
+
new_ext
)
else
:
return
os
.
path
.
join
(
new_dir
if
new_dir
is
not
None
else
self
.
dirname
,
self
.
prefix
+
"_"
+
new_ext
,
)
return
os
.
path
.
join
(
new_dir
,
self
.
prefix
+
"_"
+
new_ext
)
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets