/[gzz]/gzz/metacode/mputils.py
ViewVC logotype

Diff of /gzz/metacode/mputils.py

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

revision 1.12 by humppake, Mon Feb 10 12:03:26 2003 UTC revision 1.13 by humppake, Mon Feb 10 13:54:13 2003 UTC
# Line 20  Metapost -> PNG related stuff. Line 20  Metapost -> PNG related stuff.
20  """  """
21  import os, sys, re  import os, sys, re
22  import docutils.parsers.rst.directives, docutils.nodes, docutils.core  import docutils.parsers.rst.directives, docutils.nodes, docutils.core
23  import docutils  import docutils, docutils.utils
24  import uml  import uml
25    
26    
# Line 56  class Settings(Borg): Line 56  class Settings(Borg):
56  Stores global settings for metapost actions.  Stores global settings for metapost actions.
57  """  """
58  settings = Settings()  settings = Settings()
59  settings['tmpdir'] = os.path.abspath('doc/uml')  settings['tmpdir'] = 'doc/uml'
60    
61  #Environmental variable MPINPUTS should be relative to tmpdir,  #Environmental variable MPINPUTS should be relative to tmpdir,
62  #or be an absolute path.  #or be an absolute path.
# Line 86  def _slashify(path): Line 86  def _slashify(path):
86    
87  def transition_path(from_path, to_path):  def transition_path(from_path, to_path):
88      """      """
89        The current implementation sucks, so why wouldn't use
90        something ready and working :)
91        """
92        #terrible kludge to avoid java.lang.NegativeArraySizeException with Jython
93        from_path = os.path.normpath(os.path.abspath(from_path))
94        to_path = os.path.normpath(os.path.abspath(to_path))
95    #    print "from:", from_path, "to:", to_path+"/foo"
96        transition = docutils.utils.relative_path(from_path+"/foo", to_path)
97        transition = transition[3:len(transition)]
98    #    print "transition:", transition
99        return transition
100    
101        """
102      Returns the transition path from from_path to to_path.      Returns the transition path from from_path to to_path.
103      """      """
104      depth = from_path.count("/")      depth = from_path.count("/")

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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