Spaces:
Sleeping
Sleeping
added chmod folder permissions recursively
Browse files- Background_Substraction.py +11 -0
Background_Substraction.py
CHANGED
@@ -56,6 +56,17 @@ present_dir = os.path.dirname(os.path.realpath(__file__))
|
|
56 |
|
57 |
input_path = os.path.join(present_dir, 'wetransfer_data-zip_2024-05-17_1431')
|
58 |
base_dir = input_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
set_path = 'test'
|
60 |
selected_metadata_files = ['Slide_B_DD1s1.one_1.tif.csv', 'Slide_B_DD1s1.one_2.tif.csv']
|
61 |
ls_samples = ['Ashlar_Exposure_Time.csv', 'new_data.csv', 'DD3S1.csv', 'DD3S2.csv', 'DD3S3.csv', 'TMA.csv']
|
|
|
56 |
|
57 |
input_path = os.path.join(present_dir, 'wetransfer_data-zip_2024-05-17_1431')
|
58 |
base_dir = input_path
|
59 |
+
|
60 |
+
# Function to change permissions recursively
|
61 |
+
def change_permissions_recursive(path, mode):
|
62 |
+
for root, dirs, files in os.walk(path):
|
63 |
+
for dir in dirs:
|
64 |
+
os.chmod(os.path.join(root, dir), mode)
|
65 |
+
for file in files:
|
66 |
+
os.chmod(os.path.join(root, file), mode)
|
67 |
+
|
68 |
+
change_permissions_recursive(base_dir, 0o777)
|
69 |
+
|
70 |
set_path = 'test'
|
71 |
selected_metadata_files = ['Slide_B_DD1s1.one_1.tif.csv', 'Slide_B_DD1s1.one_2.tif.csv']
|
72 |
ls_samples = ['Ashlar_Exposure_Time.csv', 'new_data.csv', 'DD3S1.csv', 'DD3S2.csv', 'DD3S3.csv', 'TMA.csv']
|