35 |
from navidoc.util.path import * |
from navidoc.util.path import * |
36 |
|
|
37 |
dbg = config.dbg.shorthand('link') |
dbg = config.dbg.shorthand('link') |
38 |
|
config.linkpackages['clink'] = '' |
39 |
|
|
40 |
targets = {} |
targets = {} |
41 |
|
|
42 |
for docxx in config.docxx_directories: |
for docxx in config.docxx_directories: |
43 |
if os.path.isfile(slashify(docxx)+'index.html'): |
if os.path.isfile(slashify(docxx)+'index.html'): |
44 |
index = open(slashify(docxx)+'index.html') |
index = open(slashify(docxx)+'index.html') |
48 |
for link, name in tuples: |
for link, name in tuples: |
49 |
targets[name] = slashify(docxx)+link# |
targets[name] = slashify(docxx)+link# |
50 |
|
|
51 |
|
class CLinkPackage(navidoc.Element): |
52 |
|
key = "clinkpackage" |
53 |
|
|
54 |
|
def __init__(self, var, s, list): |
55 |
|
dbg("Set clinkpackage to: "+s) |
56 |
|
config.linkpackages['clink'] = s |
57 |
|
|
58 |
|
def setup_code(self): return '' |
59 |
|
|
60 |
|
def draw_code(self): return '' |
61 |
|
|
62 |
class CLink(navidoc.link.Link): |
class CLink(navidoc.link.Link): |
63 |
key = "clink" |
key = "clink" |
64 |
|
|
78 |
parts = self.target.split('.') |
parts = self.target.split('.') |
79 |
self.target = '::'.join(parts); |
self.target = '::'.join(parts); |
80 |
|
|
81 |
if len(config.linkpackage) > 0: |
if len(config.linkpackages['clink']) > 0: |
82 |
package_parts = config.linkpackage.split('.') |
package_parts = config.linkpackages['clink'].split('.') |
83 |
linkpackage = '::'.join(package_parts) |
clinkpackage = '::'.join(package_parts) |
84 |
self.target = linkpackage+'::'+self.target |
self.target = clinkpackage+'::'+self.target |
85 |
|
|
86 |
if targets.has_key(self.target): |
if targets.has_key(self.target): |
87 |
self.target = targets[self.target] |
self.target = targets[self.target] |