forked from nvaccess/nvda
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patht2t.py
31 lines (28 loc) · 1009 Bytes
/
t2t.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
###
#This file is a part of the NVDA project.
#URL: http://www.nvda-project.org/
#Copyright 2010 James Teh <[email protected]>.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License version 2.0, as published by
#the Free Software Foundation.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#This license can be found at:
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
###
def txt2tags_actionFunc(target,source,env):
import txt2tags
txt2tags.exec_command_line([str(source[0])])
def exists(env):
try:
import txt2tags
return True
except ImportError:
return False
def generate(env):
env['BUILDERS']['txt2tags']=env.Builder(
action=env.Action(txt2tags_actionFunc,lambda t,s,e: 'Converting %s to html'%s[0].path),
suffix='.html',
src_suffix='.t2t'
)