Merge lp:~vr123456/leo-editor/detect_urls into lp:leo-editor/old-trunk

Proposed by Viktor Ransmayr
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vr123456/leo-editor/detect_urls
Merge into: lp:leo-editor/old-trunk
Diff against target: 116 lines (+17/-14)
2 files modified
leo/plugins/detect_urls.py (+7/-4)
leo/plugins/leoPluginsRef.leo (+10/-10)
To merge this branch: bzr merge lp:~vr123456/leo-editor/detect_urls
Reviewer Review Type Date Requested Status
Ville M. Vainio Approve
Review via email: mp+17074@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Viktor Ransmayr (vr123456) wrote :

This contains the improvements to the plugin 'detect_urls.py'.

A quick diff should show the few changes I have made nicely.

Revision history for this message
Ville M. Vainio (villemvainio) wrote :

Seems fine to me

review: Approve
lp:~vr123456/leo-editor/detect_urls updated
2642. By Ville M. Vainio

  merge file:// support for detect_urls (by Viktor Ransmayr)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'leo/plugins/detect_urls.py'
2--- leo/plugins/detect_urls.py 2008-05-19 16:38:30 +0000
3+++ leo/plugins/detect_urls.py 2010-01-09 14:22:14 +0000
4@@ -3,14 +3,15 @@
5 #@<< docstring >>
6 #@+node:vpe.20060426084738:<< docstring >>
7 """
8-Colorizes URLs everywhere in node's body on node selection.
9+Colorizes URLs everywhere in node's body on node selection
10+or saving.
11+
12 Double click on any URL launches it in default browser.
13
14-URL regex: (http|https|ftp)://[^\s'"]+[\w=/]
15+URL regex: (http|https|file|ftp)://[^\s'"]+[\w=/]
16
17 Related plugins: color_markup.py; rClick.py
18 """
19-#@nonl
20 #@-node:vpe.20060426084738:<< docstring >>
21 #@nl
22 #@@language python
23@@ -18,7 +19,8 @@
24 import leo.core.leoGlobals as g
25 import leo.core.leoPlugins as leoPlugins
26 import re
27-url_regex = re.compile(r"""(http|https|ftp)://[^\s'"]+[\w=/]""")
28+#VR20100108: url_regex = re.compile(r"""(http|https|ftp)://[^\s'"]+[\w=/]""")
29+url_regex = re.compile(r"""(http|https|file|ftp)://[^\s'"]+[\w=/]""")
30
31 #@+others
32 #@+node:vpe.20060305064323.5:openURL()
33@@ -71,6 +73,7 @@
34 if 1:
35 leoPlugins.registerHandler("bodydclick1", openURL)
36 leoPlugins.registerHandler("select2", colorizeURLs)
37+ leoPlugins.registerHandler("save2", colorizeURLs) #VR20100108
38 g.plugin_signon(__name__)
39 #@-node:ekr.20060506070443.1:@thin detect_urls.py
40 #@-leo
41
42=== modified file 'leo/plugins/leoPluginsRef.leo'
43--- leo/plugins/leoPluginsRef.leo 2010-01-03 14:50:03 +0000
44+++ leo/plugins/leoPluginsRef.leo 2010-01-09 14:22:14 +0000
45@@ -3,7 +3,7 @@
46 <leo_file>
47 <leo_header file_format="2" tnodes="0" max_tnode_index="0" clone_windows="0"/>
48 <globals body_outline_ratio="0.5">
49- <global_window_position top="48" left="25" height="692" width="996"/>
50+ <global_window_position top="48" left="10" height="692" width="1024"/>
51 <global_log_window_position top="0" left="0" height="0" width="0"/>
52 </globals>
53 <preferences/>
54@@ -32,7 +32,7 @@
55 <v t="ekr.20090430075506.4"><vh>Notes &amp; to-do</vh>
56 <v t="ekr.20090430075506.3"><vh>@thin leoPluginNotes.txt</vh></v>
57 </v>
58-<v t="edream.110203113231.618"><vh>Plugins</vh>
59+<v t="edream.110203113231.618" a="E"><vh>Plugins</vh>
60 <v t="EKR.20040517090508"><vh> Enable plugins using @enabled-plugins nodes</vh></v>
61 <v t="ekr.20050303051035"><vh> Templates: these show recommended ways of defining plugins.</vh>
62 <v t="ekr.20041114102139"><vh>Notes</vh>
63@@ -64,9 +64,9 @@
64 <v t="ekr.20091118065749.5261"><vh>@thin ctagscompleter.py</vh></v>
65 <v t="ville.20091204224145.5355"><vh>@thin codewisecompleter.py</vh></v>
66 </v>
67-<v t="ekr.20040722135402.1"><vh>Body pane</vh>
68+<v t="ekr.20040722135402.1" a="E"><vh>Body pane</vh>
69 <v t="edream.110403140857.8"><vh>@thin color_markup.py</vh></v>
70-<v t="ekr.20060506070443.1"><vh>@thin detect_urls.py</vh></v>
71+<v t="ekr.20060506070443.1" a="E"><vh>@thin detect_urls.py</vh></v>
72 <v t="edream.110203113231.753"><vh>@thin image.py</vh></v>
73 <v t="edream.110203113231.925"><vh>@thin script_io_to_body.py</vh></v>
74 <v t="ekr.20080619090226.4"><vh>rClick plugin</vh>
75@@ -364,7 +364,7 @@
76 <v t="edream.110203113231.873"><vh>@thin at_folder.py</vh></v>
77 <v t="ekr.20040915085351"><vh>@thin at_produce.py</vh></v>
78 <v t="ktenney.20041211072654.1"><vh>@thin at_view.py</vh></v>
79-<v t="tbrown.20091029123555.5319" descendentVnodeUnknownAttributes="7d71005803000000302e3571017d710258040000007465737471037d710458050000005f6564697471057d7106580400000074686973710758120000006f6b20686f77206120626f757420746869737108737373732e"><vh>@thin attrib_edit.py</vh></v>
80+<v t="tbrown.20091029123555.5319" descendentVnodeUnknownAttributes="7d71005503302e3571017d710258040000007465737471037d710458050000005f6564697471057d7106580400000074686973710758120000006f6b20686f77206120626f757420746869737108737373732e"><vh>@thin attrib_edit.py</vh></v>
81 <v t="mork.20041020082242.1"><vh>@thin base64Packager.py</vh></v>
82 <v t="tbrown.20070322113635"><vh>@thin bookmarks.py</vh></v>
83 <v t="ekr.20060807103814.1"><vh>@thin datenodes.py</vh></v>
84@@ -801,8 +801,7 @@
85 </v>
86 <v t="ekr.20100103093121.5329"
87 marks="vivainio2.20091008133028.5823,vivainio2.20091008140054.14555,ville.20091008210853.7616,ville.20091023181249.5264,vivainio2.20091008133028.5825,ville.20091023181249.5266,"><vh>@thin stickynotes.py</vh></v>
88-<v t="ekr.20100103093121.5339"
89-marks="vivainio2.20091008133028.5823,vivainio2.20091008140054.14555,ville.20091008210853.7616,ville.20091023181249.5264,vivainio2.20091008133028.5825,ville.20091023181249.5266,"><vh>@thin stickynotes_plus.py</vh></v>
90+<v t="ekr.20100103093121.5339"><vh>@thin stickynotes_plus.py</vh></v>
91 <v t="ekr.20070119094733.1"><vh>@thin dtest.py</vh></v>
92 </v>
93 <v t="ekr.20061023142737"><vh>UNL plugin</vh>
94@@ -867,10 +866,11 @@
95 <v t="ekr.20040915075530"><vh>@thin UASearch.py</vh></v>
96 <v t="ekr.20040831122004"><vh>@thin UniversalScrolling.py</vh></v>
97 <v t="ekr.20040831115238"><vh>@thin URLloader.py</vh></v>
98-<v t="ekr.20060506070443.1"></v>
99+<v t="ekr.20060506070443.1" a="E"></v>
100 <v t="ville.20090310191936.10"><vh>@thin colorize_headlines.py</vh></v>
101 <v t="ville.20090314215508.4"><vh>@thin quicksearch.py</vh></v>
102-<v t="ville.20091008210853.5241"><vh>@thin stickynotes.py</vh></v>
103+<v t="ville.20091008210853.5241"
104+marks="vivainio2.20091008133028.5823,vivainio2.20091008140054.14555,ville.20091008210853.7616,ville.20091023181249.5264,vivainio2.20091008133028.5825,ville.20091023181249.5266,"><vh>@thin stickynotes.py</vh></v>
105 </v>
106 </v>
107 </vnodes>
108@@ -4496,7 +4496,7 @@
109 <t tx="ekr.20041114103913.1">PLEASE define each function or method in a separate node! To make this work,
110 just put @others in the root of your plugin as shown. Note that @others may be
111 nested, as shown in class myClass.</t>
112-<t tx="ekr.20041211035618" str_leo_pos="2"></t>
113+<t tx="ekr.20041211035618" str_leo_pos="2,3,1"></t>
114 <t tx="ekr.20041231134702"># This is called from plugins_menu plugin.
115
116 # It should only be defined if the extension has been registered.

Subscribers

People subscribed via source and target branches

to status/vote changes: