all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] scanrefs: match all instances of 'onlineHelp' in js files
@ 2020-10-05 14:57 Oguz Bektas
  2020-10-05 15:39 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Oguz Bektas @ 2020-10-05 14:57 UTC (permalink / raw)
  To: pbs-devel

previously it looked for the first instance. this behavior
became an issue while trying to add multiple onlineHelp buttons

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
---
 docs/_ext/proxmox-scanrefs.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/docs/_ext/proxmox-scanrefs.py b/docs/_ext/proxmox-scanrefs.py
index dd88f462..58176fe5 100644
--- a/docs/_ext/proxmox-scanrefs.py
+++ b/docs/_ext/proxmox-scanrefs.py
@@ -44,12 +44,13 @@ def scan_extjs_files(wwwdir="../www"): # a bit rough i know, but we can optimize
                 js_files.append(os.path.join(root, filename))
     for js_file in js_files:
         fd = open(js_file).read()
-        match = re.search("onlineHelp:\s*[\'\"](.*?)[\'\"]", fd) # match object is tuple
-        if match:
-            anchor = match.groups()[0]
+        allmatch = re.findall("onlineHelp:\s*[\'\"](.*?)[\'\"]", fd, re.M)
+        for match in allmatch:
+            anchor = match
             anchor = re.sub('_', '-', anchor) # normalize labels
             logger.info("found onlineHelp: {} in {}".format(anchor, js_file))
             used_anchors.append(anchor)
+
     return used_anchors
 
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] scanrefs: match all instances of 'onlineHelp' in js files
  2020-10-05 14:57 [pbs-devel] [PATCH proxmox-backup] scanrefs: match all instances of 'onlineHelp' in js files Oguz Bektas
@ 2020-10-05 15:39 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-10-05 15:39 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Oguz Bektas

On 05.10.20 16:57, Oguz Bektas wrote:
> previously it looked for the first instance. this behavior
> became an issue while trying to add multiple onlineHelp buttons
> 
> Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
> ---
>  docs/_ext/proxmox-scanrefs.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-05 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 14:57 [pbs-devel] [PATCH proxmox-backup] scanrefs: match all instances of 'onlineHelp' in js files Oguz Bektas
2020-10-05 15:39 ` [pbs-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal