This is an experiment to make --sync more intuitive based on Bjorn

Westergard’s feedback

See his post:
gemini://bjornwestergard.com/log/offpunk.gmi
This commit is contained in:
Lionel Dricot 2022-02-02 12:57:55 +01:00
parent 1881b98d96
commit ee1c660d74

View File

@ -643,6 +643,7 @@ class GeminiItem():
to_return = self._make_terminal_title() + body to_return = self._make_terminal_title() + body
return to_return return to_return
else: else:
self.links = []
return None return None
@ -2618,15 +2619,16 @@ def main():
#we add to the next tour only if we managed to cache #we add to the next tour only if we managed to cache
#the ressource #the ressource
add_to_tour(gitem) add_to_tour(gitem)
if depth > 0: #Now, recursive call, even if we didnt refresh the cache
d = depth - 1 if depth > 0:
temp_lookup = set(gc.lookup) d = depth - 1
subcount = [0,len(temp_lookup)] links = gitem.get_links()
for k in temp_lookup: subcount = [0,len(links)]
#recursive call for k in links:
substri = strin + " -->" #recursive call (validity is always 0 in recursion)
subcount[0] += 1 substri = strin + " -->"
fetch_gitem(k,depth=d,validity=0,savetotour=savetotour,\ subcount[0] += 1
fetch_gitem(k,depth=d,validity=0,savetotour=savetotour,\
count=subcount,strin=substri) count=subcount,strin=substri)
def fetch_list(list,validity=0,tourandremove=False,tourchildren=False): def fetch_list(list,validity=0,tourandremove=False,tourchildren=False):