Mercurial > libervia-web
comparison libervia/pages/lists/page_meta.py @ 1388:68ffd60a58a5
pages (lists): specify when item is coming from config
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 27 Feb 2021 20:55:35 +0100 |
parents | a84383c659b4 |
children | d6bcb0cf92d2 |
comparison
equal
deleted
inserted
replaced
1387:a84383c659b4 | 1388:68ffd60a58a5 |
---|---|
24 for list_data in lists_directory_config: | 24 for list_data in lists_directory_config: |
25 service = list_data["service"] | 25 service = list_data["service"] |
26 node = list_data["node"] | 26 node = list_data["node"] |
27 name = list_data["name"] | 27 name = list_data["name"] |
28 url = self.getPageByName("lists").getURL(service, node) | 28 url = self.getPageByName("lists").getURL(service, node) |
29 lists_directory.append({"name": name, "url": url}) | 29 lists_directory.append({"name": name, "url": url, "from_config": True}) |
30 except KeyError as e: | 30 except KeyError as e: |
31 log.warning("Missing field in lists_directory_json: {msg}".format(msg=e)) | 31 log.warning("Missing field in lists_directory_json: {msg}".format(msg=e)) |
32 except Exception as e: | 32 except Exception as e: |
33 log.warning("Can't decode lists directory: {msg}".format(msg=e)) | 33 log.warning("Can't decode lists directory: {msg}".format(msg=e)) |
34 | 34 |
44 lists_list = data_format.deserialise(lists_list_raw, type_check=list) | 44 lists_list = data_format.deserialise(lists_list_raw, type_check=list) |
45 for list_data in lists_list: | 45 for list_data in lists_list: |
46 service = list_data["service"] | 46 service = list_data["service"] |
47 node = list_data["node"] | 47 node = list_data["node"] |
48 list_data["url"] = self.getPageByName("lists").getURL(service, node) | 48 list_data["url"] = self.getPageByName("lists").getURL(service, node) |
49 list_data["from_config"] = False | |
49 lists_directory.append(list_data) | 50 lists_directory.append(list_data) |
50 | 51 |
51 icons_names = set() | 52 icons_names = set() |
52 for list_data in lists_directory: | 53 for list_data in lists_directory: |
53 try: | 54 try: |