1 new commit in clipContentsDesigner:
https://bitbucket.org/nvdaaddonteam/clipcontentsdesigner/commits/c973f0f52449/
Changeset: c973f0f52449
Branch: 2019.3
User: norrumar
Date: 2019-10-07 05:04:38+00:00
Summary: Fix sites_scons
Affected #: 5 files
diff --git a/site_scons/site_tools/doxygen.py b/site_scons/site_tools/doxygen.py
deleted file mode 100644
index d924b7c..0000000
--- a/site_scons/site_tools/doxygen.py
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# Copyright (C) 2005, 2006 Matthew A. Nicholson
-# Copyright (C) 2006 Tim Blechmann
-#Copyright (C) 2011 Michael Curran
-#Copyright (C) 2014 Alberto Buffolino
-#Copyright (C) 2016 Babbage B.V.
-#Based on code from http://www.scons.org/wiki/DoxygenBuilder
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library 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. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import os
-import os.path
-import glob
-from fnmatch import fnmatch
-from functools import reduce
-import winreg
-
-def fetchDoxygenPath():
- try:
- with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,
r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\doxygen_is1", 0,
winreg.KEY_READ | winreg.KEY_WOW64_64KEY) as doxygenKey:
- doxygenPath=
'"%s"'%os.path.join(winreg.QueryValueEx(doxygenKey, "InstallLocation")[0],
"Bin", "doxygen.exe")
- except WindowsError:
- return 'doxygen'
- return doxygenPath
-
-def DoxyfileParse(file_contents):
- """
- Parse a Doxygen source file and return a dictionary of all the values.
- Values will be strings and lists of strings.
- """
- data = {}
-
- import shlex
- lex = shlex.shlex(instream = file_contents, posix = True)
- lex.wordchars += "*+./-:"
- lex.whitespace = lex.whitespace.replace("\n", "")
- lex.escape = ""
-
- lineno = lex.lineno
- token = lex.get_token()
- key = token # the first token should be a key
- last_token = ""
- key_token = False
- next_key = False
- new_data = True
-
- def append_data(data, key, new_data, token):
- if new_data or len(data[key]) == 0:
- data[key].append(token)
- else:
- data[key][-1] += token
-
- while token:
- if token in ['\n']:
- if last_token not in ['\\']:
- key_token = True
- elif token in ['\\']:
- pass
- elif key_token:
- key = token
- key_token = False
- else:
- if token == "+=":
- if key not in data:
- data[key] = list()
- elif token == "=":
- data[key] = list()
- else:
- append_data( data, key, new_data, token )
- new_data = True
-
- last_token = token
- token = lex.get_token()
-
- if last_token == '\\' and token != '\n':
- new_data = False
- append_data( data, key, new_data, '\\' )
-
- # compress lists of len 1 into single strings
- # Wrap items into a list, since we're mutating the dictionary
- for (k, v) in list(data.items()):
- if len(v) == 0:
- data.pop(k)
-
- # items in the following list will be kept as lists and not converted to
strings
- if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]:
- continue
-
- if len(v) == 1:
- data[k] = v[0]
-
- return data
-
-def DoxySourceScan(node, env, path):
- """
- Doxygen Doxyfile source scanner. This should scan the Doxygen file and add
- any files used to generate docs to the list of source files.
- """
- default_file_patterns = [
- '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx',
- '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++',
- '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm',
- '*.py',
- ]
-
- default_exclude_patterns = [
- '*~',
- ]
-
- sources = []
-
- with open(node.abspath) as contents:
- data = DoxyfileParse(contents)
-
- if data.get("RECURSIVE", "NO") == "YES":
- recursive = True
- else:
- recursive = False
-
- file_patterns = data.get("FILE_PATTERNS", default_file_patterns)
- exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns)
-
- for node in data.get("INPUT", []):
- if os.path.isfile(node):
- sources.append(node)
- elif os.path.isdir(node):
- if recursive:
- for root, dirs, files in os.walk(node):
- for f in files:
- filename = os.path.join(root, f)
-
- pattern_check = reduce(lambda x, y: x or
bool(fnmatch(filename, y)), file_patterns, False)
- exclude_check = reduce(lambda x, y: x and fnmatch(filename,
y), exclude_patterns, True)
-
- if pattern_check and not exclude_check:
- sources.append(filename)
- else:
- for pattern in file_patterns:
- sources.extend(glob.glob("/".join([node, pattern])))
-
- sources = [env.File(path) for path in sources]
- return sources
-
-
-def DoxySourceScanCheck(node, env):
- """Check if we should scan this file"""
- return os.path.isfile(node.path)
-
-def DoxyEmitter(source, target, env):
- """Doxygen Doxyfile emitter"""
- # possible output formats and their default values and output locations
- output_formats = {
- "HTML": ("YES", "html"),
- "LATEX": ("YES", "latex"),
- "RTF": ("NO", "rtf"),
- "MAN": ("NO", "man"),
- "XML": ("NO", "xml"),
- }
-
- with open(source[0].abspath) as contents:
- data = DoxyfileParse(contents)
-
- targets = []
- out_dir = source[0].Dir(data.get("OUTPUT_DIRECTORY", "."))
-
- # add our output locations
- for (k, v) in list(output_formats.items()):
- if data.get("GENERATE_" + k, v[0]) == "YES":
- targets.append(out_dir.Dir(v[1]))
-
- # set up cleaning stuff
- for node in targets:
- env.Clean(node, node)
-
- return (targets, source)
-
-def generate(env):
- """
- Add builders and construction variables for the
- Doxygen tool. This is currently for Doxygen 1.4.6.
- """
- doxyfile_scanner = env.Scanner(
- DoxySourceScan,
- "DoxySourceScan",
- scan_check = DoxySourceScanCheck,
- )
-
- import SCons.Builder
- doxyfile_builder = SCons.Builder.Builder(
- action = "cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}",
- emitter = DoxyEmitter,
- single_source = True,
- source_scanner = doxyfile_scanner,
- )
-
- env.Append(BUILDERS = {
- 'Doxygen': doxyfile_builder,
- })
-
- env.AppendUnique(
- DOXYGEN = fetchDoxygenPath()
- )
-
-def exists(env):
- """
- Make sure doxygen exists.
- """
- return bool(fetchDoxygenPath())
-
diff --git a/site_scons/site_tools/gettextTool.py
b/site_scons/site_tools/gettextTool.py
deleted file mode 100644
index 720db9f..0000000
--- a/site_scons/site_tools/gettextTool.py
+++ /dev/null
@@ -1,30 +0,0 @@
-###
-#This file is a part of the NVDA project.
-#URL: http://www.nvda-project.org/
-#Copyright 2010-2012 NV Access Limited
-#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
-###
-
-import os
-import sys
-
-# Get the path to msgfmt.
-MSGFMT = os.path.abspath(os.path.join("miscDeps", "tools", "msgfmt.exe"))
-
-def exists(env):
- return True
-
-def generate(env):
- env['BUILDERS']['gettextMoFile']=env.Builder(
- action=env.Action([[MSGFMT,"-o","$TARGET","$SOURCE"]],
- lambda t,s,e: 'Compiling gettext template
%s'%s[0].path),
- suffix='.mo',
- src_suffix='.po'
- )
diff --git a/site_scons/site_tools/msrpc.py b/site_scons/site_tools/msrpc.py
deleted file mode 100644
index 32a273f..0000000
--- a/site_scons/site_tools/msrpc.py
+++ /dev/null
@@ -1,83 +0,0 @@
-###
-#This file is a part of the NVDA project.
-#URL: http://www.nvda-project.org/
-#Copyright 2006-2010 NVDA contributers.
-#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
-###
-
-#MSRPC tool
-#Provides the MSRPCStubs builder which can use MIDL to generate header, client
stub, and server stub files from an IDL.
-
-from SCons import Util
-from SCons.Builder import Builder
-
-#This build emitter tells the builder that a header file, a client stub c
file, and a server stub c file will be generated
-def MSRPCStubs_buildEmitter(target,source,env):
- base,ext=Util.splitext(str(target[0] if len(target)>0 else source[0]))
- newTargets=['%s.h'%base]
- if not env['MSRPCStubs_noServer']:
- newTargets.append('%s_S.c'%base)
- if not env['MSRPCStubs_noClient']:
- newTargets.append('%s_C.c'%base)
- return (newTargets,source)
-
-def MSRPCStubs_builder_actionGenerator(target,source,env,for_signature):
- sources=[]
- for src in source:
- src=str(src)
- if src.endswith('.acf'):
- sources.append('/acf %s'%src)
- else:
- sources.append(src)
- sources=" ".join(sources)
- targets=[]
- for tg in target:
- tg=str(tg)
- if tg.endswith('.h'):
- targets.append('/header %s'%tg)
- elif tg.endswith('_S.c'):
- targets.append('/sstub %s'%tg)
- elif tg.endswith('_C.c'):
- targets.append('/cstub %s'%tg)
- else:
- raise ValueError("Don't know what to do with %s"%tg)
- targets=" ".join(targets)
- noServer="/server none" if env.get('MSRPCStubs_noServer',False) else ""
- noClient="/client none" if env.get('MSRPCStubs_noClient',False) else ""
-
- prefix=env.get('MSRPCStubs_prefix',"")
- if prefix:
- prefix="/prefix all %s"%prefix
- serverPrefix=env.get('MSRPCStubs_serverPrefix',"")
- if serverPrefix:
- serverPrefix="/prefix server %s"%serverPrefix
- clientPrefix=env.get('MSRPCStubs_clientPrefix',"")
- if clientPrefix:
- clientPrefix="/prefix client %s"%clientPrefix
-
- return "
".join(['${MIDL}','${MIDLFLAGS}',noServer,noClient,prefix,serverPrefix,clientPrefix,targets,sources])
-
-MSRPCStubs_builder=Builder(
- generator=MSRPCStubs_builder_actionGenerator,
- src_suffix=['.idl','.acf'],
- emitter=MSRPCStubs_buildEmitter,
-)
-
-def exists(env):
- from SCons.Tool import midl
- return midl.exists(env)
-
-def generate(env):
- if not 'MIDL' in env:
- from SCons.Tool import midl
- midl.generate(env)
- env['BUILDERS']['MSRPCStubs']=MSRPCStubs_builder
- env['MSRPCStubs_noServer']=False
- env['MSRPCStubs_noClient']=False
diff --git a/site_scons/site_tools/recursiveInstall.py
b/site_scons/site_tools/recursiveInstall.py
deleted file mode 100644
index 6329bb2..0000000
--- a/site_scons/site_tools/recursiveInstall.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#from http://xtargets.com/2010/04/21/recursive-install-builder-for-scons/
-# This tool adds an
-#
-# env.RecursiveInstall( target, path )
-#
-# This is usefull for doing
-#
-# k = env.RecursiveInstall(dir_target, dir_source)
-#
-# and if any thing in dir_source is updated
-# the install is rerun
-#
-# It behaves similar to the env.Install builtin. However
-# it expects two directories and correctly sets up
-# the dependencies between each sub file instead
-# of just between the two directories.
-#
-# Note in also traverses the in memory node tree
-# for the source directory and can detect things
-# that are not built yet. Internally we use
-# the env.Glob function for this support.
-#
-# You can see the effect of this function by
-# doing
-#
-# scons --tree=all,prune
-#
-# and see the one to one correspondence between source
-# and target files within each directory.
-#
-
-import os
-
-def recursive_install(env, path ):
- nodes = env.Glob \
- ( os.path.join(path, '*')
- , strings=False
- )
- out = []
- for n in nodes:
- if n.isdir():
- out.extend( recursive_install(env, n.abspath ))
- else:
- out.append(n)
-
- return out
-
-def RecursiveInstall(env, target, dir):
- nodes = recursive_install(env, dir)
-
- dir = env.Dir(dir).abspath
- target = env.Dir(target).abspath
-
- l = len(dir) + 1
-
- relnodes = [ n.abspath[l:] for n in nodes ]
-
- for n in relnodes:
- t = os.path.join(target, n)
- s = os.path.join(dir, n)
- env.InstallAs ( env.File(t), env.File(s))
-
-def generate(env):
- env.AddMethod(RecursiveInstall)
-
-def exists(env):
- return True
diff --git a/site_scons/site_tools/t2t.py b/site_scons/site_tools/t2t.py
deleted file mode 100644
index e273d31..0000000
--- a/site_scons/site_tools/t2t.py
+++ /dev/null
@@ -1,31 +0,0 @@
-###
-#This file is a part of the NVDA project.
-#URL: http://www.nvda-project.org/
-#Copyright 2010 James Teh <jamie@xxxxxxxxxxx>.
-#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'
- )
Repository URL: https://bitbucket.org/nvdaaddonteam/clipcontentsdesigner/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.