/[navidoc]/navidoc/navidoc/link/__init__.py
ViewVC logotype

Diff of /navidoc/navidoc/link/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by humppake, Tue May 20 10:40:47 2003 UTC revision 1.15 by humppake, Tue May 20 11:16:08 2003 UTC
# Line 52  class Link (navidoc.Element): Line 52  class Link (navidoc.Element):
52          """          """
53          dbg(self.key+' VAR: %s, S: %s, LIST: %s' % (var, s, list))          dbg(self.key+' VAR: %s, S: %s, LIST: %s' % (var, s, list))
54    
55          redirection_path = config.working_directory          if config.link_base_directory == None:
56                redirection_path = config.working_directory
57            else: redirection_path = config.link_base_directory
58                
59          if (len(s.split(' ')) > 0):          if (len(s.split(' ')) > 0):
60              """              """
61              The 'link' may be followed by an attributed, which is              The 'link' may be followed by an attributed, which is
# Line 60  class Link (navidoc.Element): Line 63  class Link (navidoc.Element):
63              in config.              in config.
64              """              """
65              redirection = s.split(' ')[-1]              redirection = s.split(' ')[-1]
             s = s[0:len(s)-len(redirection)-1]  
66              if config.link_redirection.has_key(redirection):              if config.link_redirection.has_key(redirection):
67                    s = s[0:len(s)-len(redirection)-1]
68                  redirection_path = config.link_redirection[redirection]                  redirection_path = config.link_redirection[redirection]
69                  dbg('Redirection %s: %s' % (redirection, redirection_path))                  dbg('Redirection %s: %s' % (redirection, redirection_path))
70    
# Line 77  class Link (navidoc.Element): Line 80  class Link (navidoc.Element):
80                      link = link[0]                      link = link[0]
81                  if self.target == None or \                  if self.target == None or \
82                         not os.path.isfile(self.target):                         not os.path.isfile(self.target):
83                      if config.link_base_directory == None:                      self.target = os.path.normpath(slashify(redirection_path) + link)
                         self.target = os.path.normpath(slashify(redirection_path) + link)  
                     else:  
                         self.target = os.path.normpath(slashify(redirection_path) + link)  
84    
85              """              """
86              Final check and setting attributes.              Final check and setting attributes.

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26