rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
url = "/" + url
if url.startswith("path/"): url = "/" + url
def convertToRst_I(s,l,t): import random # split text and url i = t[0].find("|") if i>-1: url = t[0][:i] text= t[0][i+1:] else: url = t[0] text= "" text = text.strip() # Handle url if url.startswith("http://"): pass # handle document:1.2: elif url.find(ns12)>-1: url = internalLink(url) url = "/" + url # need to 'abs...
url = re.sub(r'\?.*$', '', url)
def convertToRst_I(s,l,t): import random # split text and url i = t[0].find("|") if i>-1: url = t[0][:i] text= t[0][i+1:] else: url = t[0] text= "" text = text.strip() # Handle url if url.startswith("http://"): pass # handle document:1.2: elif url.find(ns12)>-1: url = internalLink(url) url = "/" + url # need to 'abs...
def htmlBlock(s,l,t): import subprocess eout(" converting HTML with pandoc") s = t[0] s = s.replace(" ", " ") p = subprocess.Popen(['pandoc', '--from=html', '--to=rst'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ret = p.communicate(s)[0] ret = ret.replace(os.linesep, "\n") if ret.endswith("\n"): ret = ret[...
def convertHtml(i): def htmlBlock(s,l,t,): import subprocess eout(" converting HTML with pandoc") s = t[i] s = "<html>" + s + "</html>" s = s.replace("&nbsp;", " ") p = subprocess.Popen(['pandoc', '--from=html', '--to=rst'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ret = p.communicate(s)[0] ret = ret.replace(...
def htmlBlock(s,l,t): import subprocess eout(" converting HTML with pandoc") # preprocess s = t[0] s = s.replace("&nbsp;", " ") p = subprocess.Popen(['pandoc', '--from=html', '--to=rst'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ret = p.communicate(s)[0] # postprocess ret = ret.replace(os.linesep, "\n") if ret.e...
html = QuotedString("<html>", endQuoteChar="</html>").setParseAction(htmlBlock)
myHtmlBlock = convertHtml(0) html = QuotedString("<html>", endQuoteChar="</html>").setParseAction(myHtmlBlock)
def htmlBlock(s,l,t): import subprocess eout(" converting HTML with pandoc") # preprocess s = t[0] s = s.replace("&nbsp;", " ") p = subprocess.Popen(['pandoc', '--from=html', '--to=rst'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ret = p.communicate(s)[0] # postprocess ret = ret.replace(os.linesep, "\n") if ret.e...
filetool.save(filePath, fixedContent, fileEncoding)
filetool.save(filePath, fixedContent, fileEncoding) removeBOM(filePath)
def fixPng(): return
def addId(self, node, inFunction, assembledId, assembled, runtime, loadtime, lineno, variants):
def addId(self, inFunction, assembledId, runtime, loadtime, lineno):
def addId(self, node, inFunction, assembledId, assembled, runtime, loadtime, lineno, variants): if inFunction: target = runtime else: target = loadtime
if (not inFunction and self.context['jobconf'].get("dependencies/follow-static-initializers", False) and node.hasParentContext("call/operand") ): deps = self.getMethodDeps(assembledId, assembled, variants) loadtime.extend([x for x in deps if x not in loadtime])
def addId(self, node, inFunction, assembledId, assembled, runtime, loadtime, lineno, variants): if inFunction: target = runtime else: target = loadtime
def followCallDeps(self, node, fileId, assembledId): if (assembledId and assembledId in self._classesObj and assembledId != fileId and
def followCallDeps(self, node, fileId, className): if (className and className in self._classesObj and className != fileId and
def followCallDeps(self, node, fileId, assembledId): if (assembledId and assembledId in self._classesObj and # we have a class id assembledId != fileId and self.context['jobconf'].get("dependencies/follow-static-initializers", False) and node.hasParentContext("call/operand") # it's a method call ): return True r...
self.addId(node, inFunction, className, assembled, runtime, loadtime, node.get('line', -1), variants)
self.addId(inFunction, className, runtime, loadtime, node.get('line', -1))
def _analyzeClassDepsNode(self, node, loadtime, runtime, inFunction, variants):
if not inFunction and self.followCallDeps(node, fileId, assembledId):
if not inFunction and self.followCallDeps(node, fileId, className):
def _analyzeClassDepsNode(self, node, loadtime, runtime, inFunction, variants):
def getTranslationData(self, classList, variants, targetLocales): self._console.debug("Compiling filter...") pot = self.getPotFile(classList, variants) if len(pot) == 0: return {} libnames = {} for classId in classList: ns = self._classes[classId]["namespace"] libnames[ns] = True PoFiles = {} for libname in libna...
def getTranslationData(self, classList, variants, targetLocales): # Generate POT file to filter PO files self._console.debug("Compiling filter...") pot = self.getPotFile(classList, variants)
tags = []
tags = set([])
def getTagsFromJsFile(fname): fileH = open(fname,"rU") tags = [] for line in fileH: reg = re.compile('^#tag\((.*)\)'); match = reg.search(line); if match: if match.group(1): tags.append(match.group(1)); fileH.close() return tags
reg = re.compile('^
reg = re.compile('\@tag\s(.*)');
def getTagsFromJsFile(fname): fileH = open(fname,"rU") tags = [] for line in fileH: reg = re.compile('^#tag\((.*)\)'); match = reg.search(line); if match: if match.group(1): tags.append(match.group(1)); fileH.close() return tags
tags.append(match.group(1));
tags.add(match.group(1));
def getTagsFromJsFile(fname): fileH = open(fname,"rU") tags = [] for line in fileH: reg = re.compile('^#tag\((.*)\)'); match = reg.search(line); if match: if match.group(1): tags.append(match.group(1)); fileH.close() return tags
res += '{\"nr\":"%s",\"title\":"%s",\"name\":"%s", \"tags\":%s}' % (nr, title, item, repr(tags))
res += '{\"nr\":"%s",\"title\":"%s",\"name\":"%s", \"tags\":%s}' % (nr, title, item, repr(list(tags)))
def main(dist, scan): res = "" structurize = False firstCategory = True for category in os.listdir(scan): if category in [".svn", ".DS_Store"]: continue ext = os.path.splitext(category)[1] if ext == ".html" or ext == ".js": continue if not firstCategory: res += "}," res += "{" res += "\"classname\":\""+category+"\"...
self._console.info("Selenium start command: " + cmd)
self._console.debug("Selenium start command: " + cmd)
def runSimulation(self): self._console.info("Running Simulation...") javaBin = "java" javaClassPath = "-cp " configClassPath = self._job.get("simulate/java-classpath", []) qxSeleniumPath = self._job.get("simulate/qxselenium-path", False) if qxSeleniumPath: configClassPath.append(qxSeleniumPath) classPathSeparator = "...
global console console = Log(None, "info") global shell shell = ShellCmd() processLibs = None if config: if "libraries" in config: processLibs = config["libraries"] self.dir = repoDir if not os.path.isabs(self.dir): self.dir = os.path.abspath(self.dir) self.libraries = self.getLibraries(processLibs) def getLibrarie...
self.dir = os.path.abspath(repoDir) self.filter = config manifests = self.scanRepository() self.libraries = self.getLibraries(manifests) def scanRepository(self): console.indent() console.info("Scanning %s" %self.dir) demoDir = "%sdemo%s" %(os.sep,os.sep) manifestPaths = [] for root, dirs, files in os.walk(self.dir,...
def __init__(self, repoDir, config=None): """Create a new repository instance by scanning a directory containing qooxdoo libraries. By default, all libraries found will be included. Optionally, specific libraries or versions thereof can be selected using a configuration dictionary - see config.demo.json in the contrib ...
for root, dirs, files in os.walk(self.dir, topdown=True): for name in dirs[:]: if root != self.dir or name[0] == ".": dirs.remove(name) console.outdent() continue
for manifestPath in manifests: try: manifest = getDataFromJsonFile(manifestPath) except RuntimeError, e: console.error(repr(e)) if not "info" in manifest: console.warn("Manifest file %s has no 'info' section, skipping the library." %manifestPath) continue libraryName = manifest["info"]["name"] libraryVersion = manife...
def getLibraries(self, processLibs): console.info("Processing repository in %s" %self.dir) libraries = {} for root, dirs, files in os.walk(self.dir, topdown=True): for name in dirs[:]: # ignore subdirectories and SVN cruft if root != self.dir or name[0] == ".": dirs.remove(name) console.outdent() continue # only proce...
console.indent() if processLibs: if name in processLibs: console.info("Processing library %s" %name) lib = Library(self, name, processLibs[name]) libraries[name] = lib elif "*" in processLibs: console.info("Processing library %s" %name) lib = Library(self, name, processLibs["*"]) libraries[name] = lib else: console.i...
if not self.isSelected(libraryName, libraryVersion, libraryType, libraryQxVersions): continue if libraryName not in libraries: libraries[libraryName] = {} if libraryVersion not in libraries[libraryName]: console.info("Adding library %s version %s" %(libraryName,libraryVersion)) versionPath = os.path.dirname(manifest...
def getLibraries(self, processLibs): console.info("Processing repository in %s" %self.dir) libraries = {} for root, dirs, files in os.walk(self.dir, topdown=True): for name in dirs[:]: # ignore subdirectories and SVN cruft if root != self.dir or name[0] == ".": dirs.remove(name) console.outdent() continue # only proce...
def isSelectedLibrary(self, libraryName): if not "libraries" in self.filter: return True wantedLibraries = self.filter["libraries"] if "*" in wantedLibraries or libraryName in wantedLibraries: return True else: return False def isSelectedVersion(self, libraryName, libraryVersion): if not "libraries" in self.filter: r...
def getLibraries(self, processLibs): console.info("Processing repository in %s" %self.dir) libraries = {} for root, dirs, files in os.walk(self.dir, topdown=True): for name in dirs[:]: # ignore subdirectories and SVN cruft if root != self.dir or name[0] == ".": dirs.remove(name) console.outdent() continue # only proce...
for versionName in library.versions: version = library.versions[versionName]
for versionName in library: version = library[versionName]
def buildAllDemos(self, demoVersion="build", demoBrowser=None): demoData = [] for libraryName in self.libraries: library = self.libraries[libraryName] libraryData = { "classname": libraryName, "tests": [] } validDemo = False for versionName in library.versions: version = library.versions[versionName] if not version.h...
jsonData = json.dumps(demoData, sort_keys=True, indent=4)
jsonData = demjson.encode(demoData, strict=False, compactly=False)
def buildAllDemos(self, demoVersion="build", demoBrowser=None): demoData = [] for libraryName in self.libraries: library = self.libraries[libraryName] libraryData = { "classname": libraryName, "tests": [] } validDemo = False for versionName in library.versions: version = library.versions[versionName] if not version.h...
qooxdooVersions = self.libraries[library].versions[version].getManifest()["info"]["qooxdoo-versions"]
qooxdooVersions = self.libraries[library][version].getManifest()["info"]["qooxdoo-versions"]
def getDemoData(self, library, version, variant): demoDict = { "name": version + "-" + variant + ".html", "nr": variant.capitalize(), "tags": [library], "title": library + " " + version + " " + variant } qooxdooVersions = self.libraries[library].versions[version].getManifest()["info"]["qooxdoo-versions"] for ver in qo...
class Library: def __init__(self, repository = None, libraryDir = None, restrictions = None): if not (libraryDir and repository): raise RuntimeError, "Repository and library directory must be defined!" self.repository = repository self.dir = libraryDir self.path = os.path.join(self.repository.dir, self.dir) self.versio...
def getDataFromJsonFile(path): try: jsonFile = codecs.open(path, "r", "UTF-8") except: raise RuntimeError, "File %s not found" %jsonFile data = jsonFile.read() jsonFile.close() try: return demjson.decode(data, allow_comments=True) except Exception, e: raise RuntimeError, "Couldn't parse JSON from file %s" %jsonFile
def getDemoData(self, library, version, variant): demoDict = { "name": version + "-" + variant + ".html", "nr": variant.capitalize(), "tags": [library], "title": library + " " + version + " " + variant } qooxdooVersions = self.libraries[library].versions[version].getManifest()["info"]["qooxdoo-versions"] for ver in qo...
def __init__(self, library, versionDir = None): if not (library and versionDir): raise RuntimeError, "Both the library and this version's directory must be defined!" self.library = library self.dir = versionDir self.path = os.path.join(self.library.repository.dir, self.library.dir, self.dir) try: self.manifest = self....
def __init__(self, versionName, libraryName, path): self.versionName = versionName self.libraryName = libraryName self.path = path
def __init__(self, library, versionDir = None): if not (library and versionDir): raise RuntimeError, "Both the library and this version's directory must be defined!" self.library = library self.dir = versionDir self.path = os.path.join(self.library.repository.dir, self.library.dir, self.dir) try: self.manifest = self....
self.hasReadmeFile = False self.hasGenerator = False
def __init__(self, library, versionDir = None): if not (library and versionDir): raise RuntimeError, "Both the library and this version's directory must be defined!" self.library = library self.dir = versionDir self.path = os.path.join(self.library.repository.dir, self.library.dir, self.dir) try: self.manifest = self....
def checkStructure(self): if os.path.isdir(os.path.join(self.path, "source")): self.hasSourceDir = True
def checkStructure(self):
def __init__(self, library, versionDir = None): if not (library and versionDir): raise RuntimeError, "Both the library and this version's directory must be defined!" self.library = library self.dir = versionDir self.path = os.path.join(self.library.repository.dir, self.library.dir, self.dir) try: self.manifest = self....
def getLintResult(self): try: return self.lintResult except AttributeError: pass
def getLintResult(self): if not self.hasGenerator: raise RuntimeError, "%s %s has no generate.py script!" %(self.libraryName, self.versionName)
def getLintResult(self): try: return self.lintResult except AttributeError: pass from lintRunner import QxLint class LintOpts: def __init__(self,workdir,mailto = None): self.workdir = workdir self.mailto = mailto self.outputfile = None lintOpts = LintOpts(self.path) lint = QxLint(lintOpts) self.lintResult = lint.dat...
console.info("Building %s version of demo variant %s for library %s version %s" %(demoVersion,demoVariant, self.library.dir, self.dir) )
console.info("Building %s version of demo variant %s for library %s version %s" %(demoVersion,demoVariant, self.libraryName, self.versionName) )
def buildDemo(self, demoVariant = "default", demoVersion = "build"): if not self.hasDemoDir: console.error("Library %s version %s has no demo folder!" %(self.library.dir, self.dir)) return console.info("Building %s version of demo variant %s for library %s version %s" %(demoVersion,demoVariant, self.library.dir, self....
def getDataFromJsonFile(path): try: jsonFile = codecs.open(path, "r", "UTF-8") except: raise RuntimeError, "File %s not found" %jsonFile try: return json.load(jsonFile) except Exception, e: raise RuntimeError, "Couldn't parse JSON from file %s" %jsonFile
def getDataFromJsonFile(path): try: jsonFile = codecs.open(path, "r", "UTF-8") except: raise RuntimeError, "File %s not found" %jsonFile try: return json.load(jsonFile) except Exception, e: raise RuntimeError, "Couldn't parse JSON from file %s" %jsonFile
configFile = codecs.open(options.configfile, 'r', 'utf-8') configJson = configFile.read() config = json.loads(configJson)
config = getDataFromJsonFile(options.configfile)
def main(): (options,args) = getComputedConf() config = None if options.configfile: configFile = codecs.open(options.configfile, 'r', 'utf-8') configJson = configFile.read() config = json.loads(configJson) repository = Repository(options.workdir, config) if options.joblist: jobs = options.joblist.split(",") for job ...
self.demoBuildStatus = {}
def __init__(self, name, path, library): self.name = name self.path = path self.parent = library self.manifest = self._getManifest() self.readme = self._getReadme() self.data = { "classname" : self.name, "tests" : [], "manifest" : self.manifest, "readme" : self.readme } self.parent.data["children"].append(self.data) ...
self.ignoreErrors = ["Protected data field"]
def __init__(self,workdir,mailto = None): self.workdir = workdir self.mailto = mailto self.outputfile = None
self.lintResult = lint.data return self.lintResult
self.issues.append({"lint" : lint.data}) return lint.data
def __init__(self,workdir,mailto = None): self.workdir = workdir self.mailto = mailto self.outputfile = None
"BUILD_PATH" : "./" + qxVersion,
"BUILD_PATH" : buildPath,
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") repositoryData = [] console.indent() for libraryName in self.libraries: library = self.libraries[libraryName] libraryData ...
if demoBrowser: if copyDemos: demoBrowserBase = os.path.split(demoBrowser)[0] for demoStatus in buildStatus: qxVersion = demoStatus["qxVersion"] if demoStatus["buildError"]: console.warn("%s %s demo %s %s generation against qooxdoo %s failed!" %(libraryName, versionName, variant.name, buildTarget, qxVersion)) console.w...
if demoBrowser:
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") repositoryData = [] console.indent() for libraryName in self.libraries: library = self.libraries[libraryName] libraryData ...
self.copyHtmlFile(libraryName, versionName, variant.name, buildTarget, demoBrowserBase, qxVersion)
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") repositoryData = [] console.indent() for libraryName in self.libraries: library = self.libraries[libraryName] libraryData ...
def checkPatts(res, hints): for hint in hints: if hint.regex.search(res.id): hint.seen = True return True return False
def mapResourcesToClasses(self, libs, classes): ## # map a Resource obj against a set of resource id patterns def checkPatts(res, hints): for hint in hints: if hint.regex.search(res.id): hint.seen = True # mark asset hint as fullfilled by a resource return True return False
self.ignore = None
self.ignore = []
def __init__(self, logFile, ignoreStrings=None): if not logFile: raise Exception("No log file specified!") if not(os.path.exists(logFile)): raise Exception("Specified log file does not exist!") self.log = open(logFile, "r") self.ignore = None if ignoreStrings: for string in ignoreStrings: try: reg = re.compile(strin...
if self.ignore:
if len(self.ignore) > 0:
def getLogentryList(self, logEntries): logentryList = [] for entry in logEntries: ignore = False if self.ignore: for reg in self.ignore: found = reg.search(entry) if found: ignore = True continue if ignore: continue if 'level-' in entry or "testResult" in entry: entryDict = { "level" : "info", "message" : entry } if "...
"type" : "JClassDepJob"
"type" : "JCompileJob",
def listJobTriggers(): return { "api" : { "type" : "JClassDepJob" }, "collect-environment-info" : { "type" : "JSimpleJob" },
classList = computeClassList(includeWithDeps, excludeWithDeps, includeNoDeps,
classListProducer = functools.partial( computeClassList, includeWithDeps, excludeWithDeps, includeNoDeps,
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
self.runApiData(classList) elif trigger == "copy-resources": self.runResources(classList)
self.runApiData(classListProducer)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
self.runFix(classList)
self.runFix(self._classes)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
self.runLint(classList)
self.runLint(self._classes)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
self._codeGenerator.runPrettyPrinting(classList, self._classesObj)
self._codeGenerator.runPrettyPrinting(self._classes, self._classesObj)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
def runApiData(self, classList):
def runApiData(self, classListProducer):
def runApiData(self, classList): apiPath = self._job.get("api/path") if not apiPath: return
apiPath = self._config.absPath(apiPath)
classList = classListProducer() apiPath = self._config.absPath(apiPath)
def runApiData(self, classList): apiPath = self._job.get("api/path") if not apiPath: return
self._console.info("Resolving dependencies...")
self._console.info("Resolving dependencies")
def computeClassList(includeWithDeps, excludeWithDeps, includeNoDeps, excludeNoDeps, variants, verifyDeps=False, script=None): self._console.info("Resolving dependencies...") self._console.indent() classList = self._depLoader.getClassList(includeWithDeps, excludeWithDeps, includeNoDeps, excludeNoDeps, variants, verifyD...
data[classId]["run"].extend(["/resource/"+x for x in classToResources[classId]])
data[classId]["run"].extend(["/resource/resources
def depsToProviderFormat(classDepsIter, depsLogConf): data = {} # Class deps for (packageId, classId, depId, loadOrRun) in classDepsIter: if classId not in data: data[classId] = {} data[classId]["load"] = [] data[classId]["run"] = []
console.error("Found additional manifest for version %s of library %s!" %(libraryVersion,libraryName))
console.error("Found additional manifest for version %s of library %s: %s" %(libraryVersion,libraryName,manifestPath))
def getLibraries(self, manifests): console.info("Checking manifests to find valid libraries...") libraries = {} console.indent() for manifestPath in manifests: try: manifest = getDataFromJsonFile(manifestPath) except Exception, e: console.error("Could not read manifest file %s" %manifestPath) console.indent() console.e...
"tags": [library],
def getDemoData(self, library, version, variant): demoDict = { "name": variant + ".html", "nr": variant.capitalize(), "tags": [library], "title": library + " " + version + " " + variant } qooxdooVersions = self.libraries[library][version].getManifest()["info"]["qooxdoo-versions"] for ver in qooxdooVersions: demoDict["...
qooxdooVersions = self.libraries[library][version].getManifest()["info"]["qooxdoo-versions"] for ver in qooxdooVersions: demoDict["tags"].append("qxVersion_" + ver)
def getDemoData(self, library, version, variant): demoDict = { "name": variant + ".html", "nr": variant.capitalize(), "tags": [library], "title": library + " " + version + " " + variant } qooxdooVersions = self.libraries[library][version].getManifest()["info"]["qooxdoo-versions"] for ver in qooxdooVersions: demoDict["...
self._console.debug("Skip
self._console.debug("Problematic
def depsAvailWhereTarget (searchPackage, targetPackage): for depsPackage in searchPackage.packageDeps: if not isCommonAndGreaterPackage(targetPackage, depsPackage): #if not targetPackage.id & depsPackage.id == targetPackage.id: return False return True
pass
def depsAvailWhereTarget (searchPackage, targetPackage): for depsPackage in searchPackage.packageDeps: if not isCommonAndGreaterPackage(targetPackage, depsPackage): #if not targetPackage.id & depsPackage.id == targetPackage.id: return False return True
"name" : self.name + ".html",
"name" : self.name,
def _getData(self): libName = self.parent.parent.name libVersion = self.parent.name demoDict = { "name" : self.name + ".html", "nr": self.name.capitalize(), "title": libName + " " + libVersion + " " + self.name, "tags" : [ libVersion ], "manifest" : self.manifest }
"tags" : [ libVersion ],
"tags" : [ libName, libVersion ],
def _getData(self): libName = self.parent.parent.name libVersion = self.parent.name demoDict = { "name" : self.name + ".html", "nr": self.name.capitalize(), "title": libName + " " + libVersion + " " + self.name, "tags" : [ libVersion ], "manifest" : self.manifest }
transIds = set(x['id'] for x in classKeys)
transIds = set(x['id'] for x in classKeys) transIds.update(x['plural'] for x in classKeys if 'plural' in x)
def passesOutputFilter(resId): # must match some include expressions if not filter(None, [x.search(resId) for x in inclregexps]): # [None, None, _sre.match, None, _sre.match, ...] return False # must not match any exclude expressions if filter(None, [x.search(resId) for x in exclregexps]): return False return True
if resources_tree: resdata = resdata._data
def addResourceInfoToPackages(script): for package in script.packages: package_resources = [] # TODO: the next is a hack, since package.classes are still id's package_classes = [x for x in script.classesObj if x.id in package.classes] for clazz in package_classes: package_resources.extend(clazz.resources) package.dat...
for partId in parts: if packageId in parts[partId]: self._console.info("Part %s" % partId) for classId in sorted(package):
for part in parts.values(): if package in part.packages: self._console.info("Part %s" % part.name) for classId in sorted(package.classes):
def usedByDeps(depsLogConf): for packageId, package in enumerate(packages): self._console.info("Package %s" % packageId) self._console.indent()
for otherClassId in package:
for otherClassId in package.classes:
def usedByDeps(depsLogConf): for packageId, package in enumerate(packages): self._console.info("Package %s" % packageId) self._console.indent()
return txt + "\n" + linechar * len(txt)
txt = prehead + txt + "\n" + linechar * len(txt) return txt
def parseAction(s,l,t): txt = t[0].strip() return txt + "\n" + linechar * len(txt)
res += reindentBlock(t[3], 4)
res += reindentBlock(code, 4)
def convertCodeBlock(s,l,t): # t = [ 'code', ['javascript'], False, 'qx.Class.define(....)', '</code>'] # TODO: the next leaves the :: on a line of its own, where it should be # appended to the previous paragraph! res = "::\n\n" res += reindentBlock(t[3], 4) res += "\n" return res
if ret.endswith('\n'):
ret = ret.replace(os.linesep, "\n") if ret.endswith("\n"):
def htmlBlock(s,l,t): import subprocess eout(" converting HTML with pandoc") # preprocess s = t[0] s = s.replace("&nbsp;", " ") p = subprocess.Popen(['pandoc', '--from=html', '--to=rst'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ret = p.communicate(s)[0] # postprocess if ret.endswith('\n'): ret = ret[:-1] #ret =...
tradeSpaceForSpeed = True
tradeSpaceForSpeed = False
def tree(self, variantSet={}): context = self.context tradeSpaceForSpeed = True # Caution: setting this to True seems to make builds slower, at least on some platforms!?
package.compiled = dataS
package.compiled = dataS.replace('\\\\\\', '\\').replace(r'\\', '\\')
def writeI18NFiles(self, globalCodes, script):
for root, dirs, files in os.walk(path):
for root, dirs, files in filetool.walk(path):
def _scanClassPath(self, path, uri, encoding): if not os.path.exists(path): raise ValueError("The given path does not contains a class folder: %s" % path)
for root, dirs, files in os.walk(path):
for root, dirs, files in filetool.walk(path):
def _scanTranslationPath(self, path): if not os.path.exists(path): self._console.warn("The given path does not contain a translation folder: %s" % path)
url = "http://qooxdoo.org/" + url if currentInput.endswith("index.txt"): url = "pages/" + url
if url.startswith(":") or url.startswith("documentation"): if url.startswith(":"): url = url[1:] url = "http*//qooxdoo.org/" + url
def internalLink(url): # manual url if url.find(ns12)>-1: url = url[url.find(ns12)+len(ns12):] # wiki url else: if url.startswith("."): url = url[1:] url = "http://qooxdoo.org/" + url if currentInput.endswith("index.txt"): url = "pages/" + url url = url.replace(":", "/") url, ext = os.path.splitext(url) if not ext: url...
url, ext = os.path.splitext(url)
url = url.replace("*", ":") base, ext = os.path.splitext(url)
def internalLink(url): # manual url if url.find(ns12)>-1: url = url[url.find(ns12)+len(ns12):] # wiki url else: if url.startswith("."): url = url[1:] url = "http://qooxdoo.org/" + url if currentInput.endswith("index.txt"): url = "pages/" + url url = url.replace(":", "/") url, ext = os.path.splitext(url) if not ext: url...
url += ".html"
pass
def internalLink(url): # manual url if url.find(ns12)>-1: url = url[url.find(ns12)+len(ns12):] # wiki url else: if url.startswith("."): url = url[1:] url = "http://qooxdoo.org/" + url if currentInput.endswith("index.txt"): url = "pages/" + url url = url.replace(":", "/") url, ext = os.path.splitext(url) if not ext: url...
if url.startswith("http://"): return '`%s <%s>`_' % (text,url) if url.find(' keyword = "ref" if url.startswith(' path,ext = os.path.splitext(currentInput) url = path + url else: url = absolutizeUrl(url) else: keyword = "doc"
def convertToRst_A(s,l,t): i = t[0].find("|") if i>-1: url = t[0][:i] text= t[0][i+1:] else: url = t[0] text= "" text = text.strip() # Handle url if url.startswith("http://"): return '`%s <%s>`_' % (text,url) # handle intrawiki link else: url = internalLink(url) # put together with text if text: return ':doc:`%s <%s>...
return ':doc:`%s <%s>`' % (text,url) else: return ':doc:`%s`' % url
return ':%s:`%s <%s>`' % (keyword,text,url) else: return ':%s:`%s`' % (keyword,url)
def convertToRst_A(s,l,t): i = t[0].find("|") if i>-1: url = t[0][:i] text= t[0][i+1:] else: url = t[0] text= "" text = text.strip() # Handle url if url.startswith("http://"): return '`%s <%s>`_' % (text,url) # handle intrawiki link else: url = internalLink(url) # put together with text if text: return ':doc:`%s <%s>...
if not text: text = "image" + str(random.choice(range(1000))) if text.find(ns12)>-1: text = internalLink(text)
def convertToRst_I(s,l,t): import random i = t[0].find("|") if i>-1: url = t[0][:i] text= t[0][i+1:] else: url = t[0] text= "" text = text.strip() # Handle url if url.startswith("http://"): pass # handle document:1.2: elif url.find(ns12)>-1: url = internalLink(url) url = "/" + url # need to 'absolutize' internal img...
ret = "|%s|\n\n.. |%s| image:: %s\n\n" % (text,text,url)
if imgEnd.search(url): if not text: text = "image" + str(random.choice(range(1000))) if text.find(ns12)>-1: text = internalLink(text) ret = "|%s|\n\n.. |%s| image:: %s\n\n" % (text,text,url) else : if text: ret = ':doc:`%s <%s>`' % (text,url) else: ret = ':doc:`%s`' % url
def convertToRst_I(s,l,t): import random i = t[0].find("|") if i>-1: url = t[0][:i] text= t[0][i+1:] else: url = t[0] text= "" text = text.strip() # Handle url if url.startswith("http://"): pass # handle document:1.2: elif url.find(ns12)>-1: url = internalLink(url) url = "/" + url # need to 'absolutize' internal img...
txt = prehead + txt + "\n" + linechar * len(txt)
path,ext = os.path.splitext(currentInput) anchor = wikianchor(txt) label = ".. _" + path + " txt = prehead + label + txt + "\n" + linechar * len(txt)
def parseAction(s,l,t): global headLevel if headLevel > 0 and mylevel - headLevel > 1: # new header skips a level # insert intermediate headers to assure consistency prehead = "" for i in range(1, mylevel - headLevel): lchar = linechars["h"+str(headLevel+i)] prehead += "\nXXX\n" + 3 * lchar + "\n\n" else: prehead = "" ...
html | br
noteBlock | html | br | tableBlock
def htmlBlock(s,l,t): import subprocess eout(" converting HTML with pandoc") # preprocess s = t[0] s = s.replace("&nbsp;", " ") p = subprocess.Popen(['pandoc', '--from=html', '--to=rst'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ret = p.communicate(s)[0] # postprocess ret = ret.replace(os.linesep, "\n") if ret.e...
console.warn(demoStatus["buildError"])
console.warn(status["buildError"])
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") repositoryData = [] console.indent() for libraryName in self.libraries: library = self.libraries[libraryName] libraryData ...
def copyResource(res): filetool.directory(approot+"/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, approot+"/resource/"+res)
def copyResource(res, library): sourcepath = os.path.join(library['path'], library['resource'], res) targetpath = approot + "/resource/" + res filetool.directory(os.path.dirname(targetpath)) shutil.copy(sourcepath, targetpath)
def copyResource(res): filetool.directory(approot+"/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, approot+"/resource/"+res) return
copyResource(res)
library_ns = allresources[res][3] library = libraries[library_ns] copyResource(res, library)
def copyResource(res): filetool.directory(approot+"/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, approot+"/resource/"+res) return
def addResourceToPackages(script, classToResourceMap, assetId, resval):
def addResourceToPackages(script, classToResourceMap, assetId, simpleResVal=None, combImgObj=None):
def addResourceToPackages(script, classToResourceMap, assetId, resval):
if isinstance(item, types.StringTypes): return assetRex.match(item) else:
if combImgObj:
def assetRexMatchItem(assetRex, item): # assetId if isinstance(item, types.StringTypes): return assetRex.match(item) # combined image = object(used:True/False, embeds: {id:ImgInfoFmt}, info:ImgInfoFmt) else: for embId in item.embeds: if assetRex.match(embId): return True return False
if isinstance(resval, NameSpace): resvalue = resval.info.flatten() checkval = resval
if combImgObj: resvalue = combImgObj.info.flatten() checkval = combImgObj
def assetRexMatchItem(assetRex, item): # assetId if isinstance(item, types.StringTypes): return assetRex.match(item) # combined image = object(used:True/False, embeds: {id:ImgInfoFmt}, info:ImgInfoFmt) else: for embId in item.embeds: if assetRex.match(embId): return True return False
resvalue = resval
resvalue = simpleResVal
def assetRexMatchItem(assetRex, item): # assetId if isinstance(item, types.StringTypes): return assetRex.match(item) # combined image = object(used:True/False, embeds: {id:ImgInfoFmt}, info:ImgInfoFmt) else: for embId in item.embeds: if assetRex.match(embId): return True return False
addResourceToPackages(script, classToResourceMap, resId, resvalue)
addResourceToPackages(script, classToResourceMap, resId, simpleResVal=resvalue)
def serialize(filteredResources, combinedImages, resdata): for resId, resval in filteredResources.items(): # build up resdata if isinstance(resval, ImgInfoFmt): resvalue = resval.flatten() else: # handle other resources resvalue = resval resdata[resId] = resvalue # register the resource with the package needing it add...
addResourceToPackages(script, classToResourceMap, combId, combImg)
addResourceToPackages(script, classToResourceMap, combId, combImgObj=combImg)
def serialize(filteredResources, combinedImages, resdata): for resId, resval in filteredResources.items(): # build up resdata if isinstance(resval, ImgInfoFmt): resvalue = resval.flatten() else: # handle other resources resvalue = resval resdata[resId] = resvalue # register the resource with the package needing it add...
console.info("Scanning %s" %self.dir)
def scanRepository(self): console.indent() console.info("Scanning %s" %self.dir) demoDir = "%sdemo%s" %(os.sep,os.sep) manifestPaths = [] for root, dirs, files in os.walk(self.dir, topdown=True): for name in files[:]: #if "Bugs" in root: # dirs = [] # files = [] if name == "Manifest.json" and root != self.dir: consol...
if not self.validator.isValid(libraryType, libraryName, libraryVersion, libraryQxVersions):
if not self.validator.isValid(libraryName, libraryType, libraryVersion, libraryQxVersions):
def getLibraries(self, manifests): libraries = {} for manifestPath in manifests: try: manifest = getDataFromJsonFile(manifestPath) except RuntimeError, e: console.error(repr(e)) if not "info" in manifest: console.warn("Manifest file %s has no 'info' section, skipping the library." %manifestPath) continue libraryName ...
console.outdent()
def buildAllDemos(self, demoVersion="build", demoBrowser=None): demoData = [] for libraryName in self.libraries: library = self.libraries[libraryName] libraryData = { "classname": libraryName, "tests": [] } validDemo = False for versionName in library: version = library[versionName] if not version.hasDemoDir: continu...
if not "types" in config: config["types"] = ["*"]
if not config: config = {}
def setDefaults(self, config): if not "types" in config: config["types"] = ["*"] if not "libraries" in config: config["libraries"] = { "*" : {} } for libName, lib in config["libraries"].iteritems(): if not "versions" in lib: lib["versions"] = ["*"] if not "qooxdoo-versions" in lib: lib["qooxdoo-versions"] = ["*"] retur...
def isValidType(self, type): return self.isValidKey(type, self.config["types"])
def isValidType(self, type): return self.isValidKey(type, self.config["types"])
def isValid(self, type, libName, version, qxVersions): return self.isValidType(type) and self.isValidLibrary(libName) and self.isValidVersion(libName, version) and self.isValidQxVersion(libName, qxVersions)
def isValid(self, libName, type, version, qxVersions): return self.isValidLibrary(libName) and self.isValidType(libName, type) and self.isValidVersion(libName, version) and self.isValidQxVersion(libName, qxVersions)
def isValid(self, type, libName, version, qxVersions): return self.isValidType(type) and self.isValidLibrary(libName) and self.isValidVersion(libName, version) and self.isValidQxVersion(libName, qxVersions)
self.cacheId = "class-%s" % self.path
def __init__(self, id, path, library, context, container): #__slots__ = ('id', 'path', 'size', 'encoding', 'library', 'context', 'source', 'scopes', 'translations') global console, cache, DefaultIgnoredNamesDynamic super(Class, self).__init__(path) self.id = id # qooxdoo name of class, classId self.libr...
def getTransitiveDepsR1(dependencyItem, variants, totalDeps): classId = dependencyItem.name methodId = dependencyItem.attribute function_pruned = False if classId not in self._classesObj: console.debug("Skipping unknown class of dependency: %s dependencyItem.requestor, dependencyItem.line)) console.outdent() retur...
def getTransitiveDepsR1(dependencyItem, variants, totalDeps):
qxPath = letConfig['QOOXDOO_PATH']
qxPath = self._config.absPath(letConfig['QOOXDOO_PATH'])
def runCollectEnvironmentInfo(self): letConfig = self._job.get('let',{}) self._console.info("Environment information") self._console.indent() platformInfo = util.getPlatformInfo() self._console.info("Platform: %s %s" % (platformInfo[0], platformInfo[1])) self._console.info("Python version: %s" % sys.version) if 'QO...
compDir = cacheCfg['compile']
compDir = self._config.absPath(cacheCfg['compile'])
def runCollectEnvironmentInfo(self): letConfig = self._job.get('let',{}) self._console.info("Environment information") self._console.indent() platformInfo = util.getPlatformInfo() self._console.info("Platform: %s %s" % (platformInfo[0], platformInfo[1])) self._console.info("Python version: %s" % sys.version) if 'QO...
downDir = cacheCfg['downloads']
downDir = self._config.absPath(cacheCfg['downloads'])
def runCollectEnvironmentInfo(self): letConfig = self._job.get('let',{}) self._console.info("Environment information") self._console.indent() platformInfo = util.getPlatformInfo() self._console.info("Platform: %s %s" % (platformInfo[0], platformInfo[1])) self._console.info("Python version: %s" % sys.version) if 'QO...
(_, _, _ ) = partsConfigFromClassList(excludeWithDeps, script)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
self._codeGenerator.runSource (script, self._libs, self._classes, self._classesObj) self._codeGenerator.runCompiled(script, self._treeCompiler)
if set(("compile", "compile-source", "compile-dist")).intersection(jobTriggers): partsConfigFromClassList(excludeWithDeps, script) self._codeGenerator.runSource (script, self._libs, self._classes, self._classesObj) self._codeGenerator.runCompiled(script, self._treeCompiler)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
if combId in filteredResources:
if combId in resdata:
def serialize(filteredResources, combinedImages, resdata): for resId, resval in filteredResources.items(): # build up resdata if isinstance(resval, ImgInfoFmt): resvalue = resval.flatten() else: # handle other resources resvalue = resval resdata[resId] = resvalue # register the resource with the package needing it add...