gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] navidoc ./rst2any.py navidoc/link/__init__.py n...


From: Asko Soukka
Subject: [Gzz-commits] navidoc ./rst2any.py navidoc/link/__init__.py n...
Date: Fri, 25 Apr 2003 09:36:41 -0400

CVSROOT:        /cvsroot/navidoc
Module name:    navidoc
Changes by:     Asko Soukka <address@hidden>    03/04/25 09:36:41

Modified files:
        .              : rst2any.py 
        navidoc/link   : __init__.py 
        navidoc/mp     : __init__.py 

Log message:
        some

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/rst2any.py.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/link/__init__.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/mp/__init__.py.diff?tr1=1.20&tr2=1.21&r1=text&r2=text

Patches:
Index: navidoc/navidoc/link/__init__.py
diff -u navidoc/navidoc/link/__init__.py:1.10 
navidoc/navidoc/link/__init__.py:1.11
--- navidoc/navidoc/link/__init__.py:1.10       Thu Apr 24 05:41:10 2003
+++ navidoc/navidoc/link/__init__.py    Fri Apr 25 09:36:41 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: __init__.py,v 1.10 2003/04/24 09:41:10 humppake Exp $
+#$Id: __init__.py,v 1.11 2003/04/25 13:36:41 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -47,11 +47,25 @@
     target = None
 
     def __init__(self, var, s, list):
+        """
+        Initilizes link.
+        """
         dbg(self.key+" VAR: %s, S: %s, LIST: %s" % (var, s, list))
         self.title = s.strip()
 
-        if len(list) > 0:
-            self.target = os.path.normpath(slashify(config.working_directory) 
+ list[0])
+        if (len(list) > 0):
+            """
+            Multiple link could be given.
+            Let working link overwrite current.
+            """
+            for link in list:
+                if type(link) == type([]):
+                    link = link[0]
+                if self.target == None or not os.path.isfile(self.target):
+                    self.target = 
os.path.normpath(slashify(config.working_directory) + link)
+            """
+            Final check and setting attributes.
+            """
             self.set_status(set_title=1)
         
         dbg(self.key+" title: %s, target: %s, error: %s" % (self.title, 
self.target, self.error))
@@ -72,9 +86,11 @@
         if not self.error and set_title:
             file = open(path)                
             title = re.compile('<title>([^<]*)</title>')
+            strip = re.compile('[a-zA-ZåäöÅÄÖ ]*')
             title = title.findall(file.read())
             file.close()
-            if len(title) > 0: self.title = title[0]
+            if len(title) > 0:
+                self.title = strip.findall(title[0])[0]
 
         if not self.error and os.path.abspath(path) \
            == 
os.path.abspath(slashify(config.working_directory)+config.output_filename):
Index: navidoc/navidoc/mp/__init__.py
diff -u navidoc/navidoc/mp/__init__.py:1.20 navidoc/navidoc/mp/__init__.py:1.21
--- navidoc/navidoc/mp/__init__.py:1.20 Thu Apr 24 12:13:37 2003
+++ navidoc/navidoc/mp/__init__.py      Fri Apr 25 09:36:41 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: __init__.py,v 1.20 2003/04/24 16:13:37 humppake Exp $
+# $Id: __init__.py,v 1.21 2003/04/25 13:36:41 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -123,7 +123,7 @@
                 title = title.findall(refers_file.read())
                 refers_file.close()
             except IOError:
-                raise MetaposException("Reference file defined in 
"+refers[id]+" was not found.")
+                raise MetapostException("Referenced file %s defined in %s was 
not found." % (refers[id], filepath))
 
             if len(title) > 0: title = title[0]
             else: title = refers[id].split("/")[-1].split(".")[0]
Index: navidoc/rst2any.py
diff -u navidoc/rst2any.py:1.22 navidoc/rst2any.py:1.23
--- navidoc/rst2any.py:1.22     Thu Apr 24 03:48:04 2003
+++ navidoc/rst2any.py  Fri Apr 25 09:36:41 2003
@@ -21,7 +21,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: rst2any.py,v 1.22 2003/04/24 07:48:04 humppake Exp $
+#$Id: rst2any.py,v 1.23 2003/04/25 13:36:41 humppake Exp $
 
 #
 # Written by Asko Soukka
@@ -95,6 +95,12 @@
         if not output.endswith('index'):
             output = output+'.gen.html'
         else:
+# XXX - No more exceptions like this - XXX
+# (from TODO)
+#   - ".gen." midfix to be optional:
+#    + replacing ".gen" with global attribute
+#    + replacing some foo[a:b] with foo[a:len(midfix)+c]
+
             # For practical reasons, we need to transform
             # index.rst into index.html ...
             output = output+'.html'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]