Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/plugins/leoPluginsRef.leo

leo
Discussion topic

Back to topic list

CVS update: /leo/plugins/leoPluginsRef.leo

Author bwmulder
Full name Bernhard Mulder
Date 2006-08-07 08:39:33 PDT
Message User: bwmulder
Date: 2006-08-07 08:39:33-0700
Log:
 Add shadow button

File Changes:

Directory: /leo/plugins/
========================

File [changed]: leoPluginsRef.leo
Url: http://leo.tigris.or​g/source/browse/leo/​plugins/leoPluginsRe​f.leo?r1=1.20&r2​=1.21
Delta lines: +57 -6
--------------------
--- leoPluginsRef.leo 2006-08-01 09:15:02-0700 1.20
+++ leoPluginsRef.leo 2006-08-07 08:39:26-0700 1.21
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet ekr_stylesheet?>
 <leo_file>
-<leo_header file_format="2" tnodes="0" max_tnode_index="7415" clone_windows="0"/>
+<leo_header file_format="2" tnodes="0" max_tnode_index="7416" clone_windows="0"/>
 <globals body_outline_ratio="​0.563037249284">
     <global_window_position top="26" left="277" height="660" width="922"/>
     <global_log_window_position top="0" left="0" height="0" width="0"/>
@@ -9,7 +9,7 @@
 <preferences/>
 <find_panel_settings/>
 <vnodes>
-<v t="ekr.2004121103561​8"><vh>Scri​pts, buttons &amp; settings</vh>
+<v t="ekr.20041211035618" a="E"><vh>Scripts, buttons &amp; settings</vh>
 <v t="EKR.2004051707511​0"><vh>repl​aceLeoGlobals</vh​>
 <v t="EKR.2004051707511​0.1"><vh>​&lt;&lt; set nameList to the list of functions in leoGlobals.py &gt;&gt;<​/vh></v>
 <v t="EKR.2004051707511​0.2"><vh>fi​ndFunctionsInTree​</vh></v>
@@ -39,6 +39,7 @@
 <v t="ekr.2005072410033​4"><vh>@but​ton Beautify</vh></v>
 <v t="ekr.2005102514411​6"><vh>@but​ton Spell</vh></v>
 <v t="ekr.2005081905574​6"><vh>@but​ton Save</vh></v>
+<v t="bwmulder.20060807​083225"><vh​>@button shadow</vh></v>
 <v t="ekr.2005072207581​2"><vh>Remo​ve blank trailing lines</vh></v>
 </v>
 <v t="edream.1102031132​31.618"><vh​>Plugins</vh>
@@ -1047,9 +1048,9 @@
 </v>
 <v t="ekr.20060715100156.8"
 expanded="ekr.200607​15100156.11,ekr.2006​0715100156.12,">​<vh>@thin mod_shadow_core.py​</vh></v>
-<v t="ekr.20060715100156.52" a="TV"
+<v t="ekr.20060715100156.52" a="E"
 marks="ekr.20060715100156.53,"
-expanded="ekr.20060​715100156.71,ekr.200​60715100156.74,">​<vh>@thin mod_shadow.py</vh​></v>
+expanded="ekr.20060​715100156.68,ekr.200​60715100156.71,ekr.2​0060715100156.74,"​><vh>@thin mod_shadow.py</vh​></v>
 <v t="ekr.2006071510085​3"><vh>@thi​n ../LeoShadow/readme.​txt</vh></v​>
 </v>
 </vnodes>
@@ -1432,6 +1433,56 @@
 File names may be indented as desired.
 
 @color</t>
+<t tx="bwmulder.2006080​7083225">"""
+Look for @thin files in the current subtree.
+Convert those thin files into a file with a shadow file,
+if this shadow file does not exist already.
+
+FIXME: the line end convention is currently changed:
+ unix lineendings are converted to DOS lineendings,
+ if files are converted on Windows.
+ Not sure if that is a probem or not.
+"""
+def l(filename):
+ return g.comment_delims_fro​m_extension(filename​)[0]
+import mod_shadow_core, os, shutil
+for p in p.self_and_subtree_iter():
+ s = p.headString()
+ sstrip = s.strip()
+ if sstrip.startswith("@thin"):
+ # shadow_subdir = c.config.shadow_subdir
+ shadow_subdir = c.config.getString("​shadow_subdir")
+ # prefix = c.config.prefix
+ prefix = c.config.getString("​shadow_prefix")
+ start = sstrip.find("@thin") + len("@thin")
+ leofiledir = os.path.split(c.mFileName)[0]
+ filename = sstrip[start:].strip()
+ fullfilename = os.path.join(leofiledir, filename)
+ dir = os.path.split(fullfilename)[0]
+ leoFolder = os.path.join(leofiledir, dir, shadow_subdir)
+ if not os.path.exists(leoFolder):
+ os.mkdir(leoFolder)
+ assert os.path.exists(leoFolder)
+ else:
+ assert os.path.isdir(leoFolder)
+ dir, name = os.path.split(filename)
+ newname = os.path.join(leoFolder, prefix + name)
+ if os.path.exists(newname):
+ continue
+ g.es( "renaming %s to %s" % (filename, newname))
+ shutil.copy2(fullfilename, newname)
+ os.unlink(fullfilename)
+ f = file(fullfilename, "w")
+ f.close()
+ mod_shadow_core.copy​_file_removing_senti​nels(
+ sourcefilename=newname,
+ targetfilename=fullfilename,
+ marker_from_extension = l)
+ g.es("File %s is now shadowed" % filename)
+
+
+
+</t>
 <t tx="edream.110203113​231.233">@ To do:
     
      WARNING: problems with locking out event handlers could cause Leo to drop Text!
@@ -3776,8 +3827,8 @@
                  # Parse revision line.
                  s = reader.read()
                  s = subs_glossary([s])[0]
-- # Match RCS/CVS $Id: leoPluginsRef.leo,v 1.20 2006/08/01 16:15:02 edream Exp $ marker format.
-+ # Match RCS/CVS $Id: leoPluginsRef.leo,v 1.20 2006/08/01 16:15:02 edream Exp $ marker format.
+- # Match RCS/CVS $Id: leoPluginsRef.leo,v 1.21 2006/08/07 15:39:26 bwmulder Exp $ marker format.
++ # Match RCS/CVS $Id: leoPluginsRef.leo,v 1.21 2006/08/07 15:39:26 bwmulder Exp $ marker format.
                  mo = re.match(r'^\$Id: \S+ (?P&lt;revision​&gt;\S+)' \
                      ' (?P&lt;date&gt;\S+) \S+ \S+ \S+ \$$',s)
                  if not mo:

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/plugins/leoPluginsRef.leo bwmulder Bernhard Mulder 2006-08-07 08:39:33 PDT
Messages per page: