Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Sen2Chain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESPACE-DEV
Sen2Chain
Commits
b35a65f6
Commit
b35a65f6
authored
5 years ago
by
pascal.mouquet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
new utilis to set right permissions after sen2cor, executed durin L1cProduct.process_l2a
parent
15348fba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sen2chain/products.py
+4
-1
4 additions, 1 deletion
sen2chain/products.py
sen2chain/tiles.py
+7
-3
7 additions, 3 deletions
sen2chain/tiles.py
sen2chain/utils.py
+16
-0
16 additions, 0 deletions
sen2chain/utils.py
with
27 additions
and
4 deletions
sen2chain/products.py
+
4
−
1
View file @
b35a65f6
...
...
@@ -13,7 +13,7 @@ from pathlib import Path
# type annotations
from
typing
import
List
,
Tuple
,
Optional
from
.utils
import
grouper
from
.utils
import
grouper
,
setPermissions
from
.config
import
Config
,
SHARED_DATA
from
.xmlparser
import
MetadataParser
from
.sen2cor
import
process_sen2cor
...
...
@@ -206,6 +206,7 @@ class L1cProduct(Product):
# the newly L2A must be moved to his L2A library folder.
if
self
.
_library_product
:
l2a_prod
.
archive
()
L2aProduct
(
l2a_identifier
).
setPermissions
()
return
self
# METADATA
...
...
@@ -513,6 +514,8 @@ class L2aProduct(Product):
return
self
def
setPermissions
(
self
):
setPermissions
(
self
.
path
)
# def has_indice(self, indice):
# """
...
...
This diff is collapsed.
Click to expand it.
sen2chain/tiles.py
+
7
−
3
View file @
b35a65f6
...
...
@@ -563,8 +563,12 @@ class Tile:
outfullpath
=
l2a
.
path
.
parent
/
(
p
[
39
:
44
]
+
'
_
'
+
p
[
0
:
4
]
+
p
[
11
:
19
]
+
'
_QL_latest.jpg
'
)
old_ql
=
list
(
l2a
.
path
.
parent
.
glob
(
'
*_QL_latest.jpg*
'
))
for
f
in
old_ql
:
liste
=
[
a
for
a
in
old_ql
if
str
(
outfullpath
)
not
in
str
(
a
)]
for
f
in
liste
:
f
.
unlink
()
l2a
.
process_ql
(
out_path
=
outfullpath
,
out_resolution
=
(
750
,
750
),
jpg
=
True
)
if
outfullpath
in
old_ql
:
logger
.
info
(
"
{} - Latest QL already done
"
.
format
(
self
.
name
))
return
else
:
l2a
.
process_ql
(
out_path
=
outfullpath
,
out_resolution
=
(
750
,
750
),
jpg
=
True
)
This diff is collapsed.
Click to expand it.
sen2chain/utils.py
+
16
−
0
View file @
b35a65f6
...
...
@@ -89,4 +89,20 @@ def getFolderSize(folder, follow_symlinks = False):
except
:
pass
return
total_size
def
setPermissions
(
path
):
for
dir_path
,
dir_names
,
files
in
os
.
walk
(
str
(
path
)):
for
d
in
dir_names
:
name
=
dir_path
+
'
/
'
+
d
os
.
chmod
(
name
,
os
.
stat
(
name
).
st_mode
|
0o075
)
os
.
chmod
(
name
,
os
.
stat
(
name
).
st_mode
&
~
0o002
)
for
f
in
files
:
name
=
dir_path
+
'
/
'
+
f
os
.
chmod
(
name
,
os
.
stat
(
name
).
st_mode
|
0o064
)
os
.
chmod
(
name
,
os
.
stat
(
name
).
st_mode
&
~
0o003
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment