Skip to content

Commit cd9da68

Browse files
committed
updated v0.4.6
- Now inclues asset_url and thumbnail_url for search. - Formatting and general improvements.
1 parent e5beb94 commit cd9da68

17 files changed

+702
-415
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ Required named arguments.:
267267

268268
### Changelog
269269

270+
### v0.4.6
271+
- Now inclues asset_url and thumbnail_url for search.
272+
- Formatting and general improvements.
273+
270274
### v0.4.5
271275
- Now inclues license in sdist
272276
- Fixed issue with app2script tool and string and text parsing.

dist/geeadd-0.4.5-py3-none-any.whl

-27.2 KB
Binary file not shown.

dist/geeadd-0.4.5.tar.gz

-21.6 KB
Binary file not shown.

dist/geeadd-0.4.6-py3-none-any.whl

27.5 KB
Binary file not shown.

dist/geeadd-0.4.6.tar.gz

21.5 KB
Binary file not shown.

docs/changelog/index.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,20 @@
518518
<label class="md-nav__title" for="__toc">Table of contents</label>
519519
<ul class="md-nav__list" data-md-scrollfix>
520520

521+
<li class="md-nav__item">
522+
<a href="#v046" class="md-nav__link">
523+
v0.4.6
524+
</a>
525+
526+
</li>
527+
528+
<li class="md-nav__item">
529+
<a href="#v045" class="md-nav__link">
530+
v0.4.5
531+
</a>
532+
533+
</li>
534+
521535
<li class="md-nav__item">
522536
<a href="#v044" class="md-nav__link">
523537
v0.4.4
@@ -661,6 +675,20 @@
661675
<label class="md-nav__title" for="__toc">Table of contents</label>
662676
<ul class="md-nav__list" data-md-scrollfix>
663677

678+
<li class="md-nav__item">
679+
<a href="#v046" class="md-nav__link">
680+
v0.4.6
681+
</a>
682+
683+
</li>
684+
685+
<li class="md-nav__item">
686+
<a href="#v045" class="md-nav__link">
687+
v0.4.5
688+
</a>
689+
690+
</li>
691+
664692
<li class="md-nav__item">
665693
<a href="#v044" class="md-nav__link">
666694
v0.4.4
@@ -793,6 +821,18 @@
793821

794822

795823
<h1 id="changelog">Changelog<a class="headerlink" href="#changelog" title="Permanent link">&para;</a></h1>
824+
<h3 id="v046">v0.4.6<a class="headerlink" href="#v046" title="Permanent link">&para;</a></h3>
825+
<ul>
826+
<li>Now inclues asset_url and thumbnail_url for search.</li>
827+
<li>Formatting and general improvements.</li>
828+
</ul>
829+
<h3 id="v045">v0.4.5<a class="headerlink" href="#v045" title="Permanent link">&para;</a></h3>
830+
<ul>
831+
<li>Now inclues license in sdist</li>
832+
<li>Fixed issue with app2script tool and string and text parsing.</li>
833+
<li>Added readme and version tools.</li>
834+
<li>Added readme docs and deployed environment.</li>
835+
</ul>
796836
<h3 id="v044">v0.4.4<a class="headerlink" href="#v044" title="Permanent link">&para;</a></h3>
797837
<ul>
798838
<li>Removed git dependency and used urllib instead based on <a href="https://github.com/samapriya/gee_asset_manager_addon/issues/10">feedback</a></li>

docs/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/sitemap.xml.gz

0 Bytes
Binary file not shown.

geeadd/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
__author__ = 'Samapriya Roy'
4-
__email__ = '[email protected]'
5-
__version__ = '0.4.5'
3+
__author__ = "Samapriya Roy"
4+
__email__ = "[email protected]"
5+
__version__ = "0.4.6"

geeadd/acl_changer.py

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
__copyright__ = """
32
43
Copyright 2020 Samapriya Roy
@@ -22,92 +21,93 @@
2221
import itertools
2322

2423
# Empty Lists
25-
folder_paths=[]
26-
image_list=[]
27-
collection_list=[]
28-
table_list=[]
24+
folder_paths = []
25+
image_list = []
26+
collection_list = []
27+
table_list = []
2928

3029
# Recursive folder paths
3130
def recursive(path):
32-
if ee.data.getInfo(path)['type'].lower()=='folder':
33-
children = ee.data.getList({'id': path})
31+
if ee.data.getInfo(path)["type"].lower() == "folder":
32+
children = ee.data.getList({"id": path})
3433
folder_paths.append(path)
35-
val=[child['type'].lower()=='folder' for child in children]
36-
while len(val)>0 and True in val:
34+
val = [child["type"].lower() == "folder" for child in children]
35+
while len(val) > 0 and True in val:
3736
for child in children:
38-
if child['type'].lower()=='folder':
39-
folder_paths.append(child['id'])
40-
children = ee.data.getList({'id': child['id']})
41-
val=[child['type'].lower()=='folder' for child in children]
42-
print('Total folders: {}'.format(len(folder_paths)))
37+
if child["type"].lower() == "folder":
38+
folder_paths.append(child["id"])
39+
children = ee.data.getList({"id": child["id"]})
40+
val = [child["type"].lower() == "folder" for child in children]
41+
print("Total folders: {}".format(len(folder_paths)))
4342
return folder_paths
4443

44+
4545
# folder parse
4646
def fparse(path):
4747
ee.Initialize()
48-
if ee.data.getInfo(path)['type'].lower()=='folder':
49-
gee_folder_path=recursive(path)
48+
if ee.data.getInfo(path)["type"].lower() == "folder":
49+
gee_folder_path = recursive(path)
5050
for folders in gee_folder_path:
51-
children = ee.data.getList({'id': folders})
51+
children = ee.data.getList({"id": folders})
5252
for child in children:
53-
if child['type'].lower()=='imagecollection':
54-
collection_list.append(child['id'])
55-
elif child['type'].lower()=='image':
56-
image_list.append(child['id'])
57-
elif child['type'].lower()=='table':
58-
table_list.append(child['id'])
59-
elif ee.data.getInfo(path)['type'].lower()=='image':
53+
if child["type"].lower() == "imagecollection":
54+
collection_list.append(child["id"])
55+
elif child["type"].lower() == "image":
56+
image_list.append(child["id"])
57+
elif child["type"].lower() == "table":
58+
table_list.append(child["id"])
59+
elif ee.data.getInfo(path)["type"].lower() == "image":
6060
image_list.append(path)
61-
elif ee.data.getInfo(path)['type'].lower()=='image_collection':
61+
elif ee.data.getInfo(path)["type"].lower() == "image_collection":
6262
collection_list.append(path)
63-
elif ee.data.getInfo(path)['type'].lower()=='table':
63+
elif ee.data.getInfo(path)["type"].lower() == "table":
6464
table_list.append(path)
6565
else:
66-
print(ee.data.getInfo(path)['type'].lower())
67-
return [collection_list,table_list,image_list,folder_paths]
66+
print(ee.data.getInfo(path)["type"].lower())
67+
return [collection_list, table_list, image_list, folder_paths]
6868

6969

7070
##request type of asset, asset path and user to give permission
71-
def access(collection_path,user,role):
71+
def access(collection_path, user, role):
7272
ee.Initialize()
73-
asset_list=fparse(collection_path)
73+
asset_list = fparse(collection_path)
7474
asset_names = list(itertools.chain(*asset_list))
75-
print('Changing permission for total of '+str(len(asset_names))+' items.....')
76-
for count,init in enumerate(asset_names):
77-
print('Working on ===> {}'.format(init))
75+
print("Changing permission for total of " + str(len(asset_names)) + " items.....")
76+
for count, init in enumerate(asset_names):
77+
print("Working on ===> {}".format(init))
7878
acl = ee.data.getAssetAcl(init)
79-
if role=='reader':
80-
if not user in acl['readers']:
81-
baselist=acl['readers']
79+
if role == "reader":
80+
if not user in acl["readers"]:
81+
baselist = acl["readers"]
8282
baselist.append(user)
83-
acl['readers']=baselist
84-
acl['owners']=[]
83+
acl["readers"] = baselist
84+
acl["owners"] = []
8585
try:
8686
ee.data.setAssetAcl(init, json.dumps(acl))
8787
except Exception as e:
8888
print(e)
8989
else:
90-
print('user already has read access to this asset:SKIPPING')
91-
if role=='writer':
92-
if not user in acl['writers']:
93-
baselist=acl['writers']
90+
print("user already has read access to this asset:SKIPPING")
91+
if role == "writer":
92+
if not user in acl["writers"]:
93+
baselist = acl["writers"]
9494
baselist.append(user)
95-
acl['readers']=baselist
96-
acl['owners']=[]
95+
acl["readers"] = baselist
96+
acl["owners"] = []
9797
try:
9898
ee.data.setAssetAcl(init, json.dumps(acl))
9999
except Exception as e:
100100
print(e)
101101
else:
102-
print('user already has write access to this asset:SKIPPING')
103-
if role=='delete':
104-
if not user in acl['readers']:
105-
print('user does not have permission:SKIPPING')
102+
print("user already has write access to this asset:SKIPPING")
103+
if role == "delete":
104+
if not user in acl["readers"]:
105+
print("user does not have permission:SKIPPING")
106106
else:
107-
baselist=acl['readers']
107+
baselist = acl["readers"]
108108
baselist.remove(user)
109-
acl['readers']=baselist
110-
acl['owners']=[]
109+
acl["readers"] = baselist
110+
acl["owners"] = []
111111
try:
112112
ee.data.setAssetAcl(init, json.dumps(acl))
113113
except Exception as e:

0 commit comments

Comments
 (0)