bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def __init__(self, fpath, enc=default_encoding): """ Constructor. | def __init__(self, fpath, enc=default_encoding): """ Constructor. | 447,200 |
def __init__(self, fpath, enc=default_encoding): """ Constructor. | def __init__(self, fpath, enc=default_encoding): - *encoding*: string, the encoding to use, defaults to "default_encoding" global variable (optional), - *check_for_duplicates*: whether to check for duplicate entries when adding entries to the file, default: False (optional). """ enc = kwargs.get('encoding', default_enc... | 447,201 |
def __init__(self, fpath, enc=default_encoding): """ Constructor. | def __init__(self, fpath, enc=default_encoding): """ Constructor. | 447,202 |
def __init__(self, fpath, enc=default_encoding): """ Constructor. | def __init__(self, fpath, enc=default_encoding): """ Constructor. | 447,203 |
def __init__(self, fpath, enc=default_encoding): """ Constructor. | def __init__(self, fpath, enc=default_encoding): """ Constructor. | 447,204 |
def __init__(self, fpath, enc=default_encoding): """ Constructor. | def __init__(self, fpath, enc=default_encoding): """ Constructor. | 447,205 |
def handle_mc(self): """Handle a msgid or msgstr continuation line.""" if self.current_state == 'MI': self.current_entry.msgid += unescape(self.current_token[1:-1]) elif self.current_state == 'MP': self.current_entry.msgid_plural += \ unescape(self.current_token[1:-1]) elif self.current_state == 'MS': self.current_entr... | def handle_mc(self): """Handle a msgid or msgstr continuation line.""" if self.current_state == 'CT': self.current_entry.msgctxt += unescape(self.current_token[1:-1]) elif self.current_state == 'MI': self.current_entry.msgid += unescape(self.current_token[1:-1]) elif self.current_state == 'MP': self.current_entry.msgid... | 447,206 |
def __init__(self, fpath, enc=default_encoding): """_MOFileParser constructor.""" self.fhandle = open(fpath, 'rb') self.instance = MOFile(fpath=fpath, encoding=enc) | def __init__(self, fpath, *args, **kwargs): """ Constructor. **Arguments**: - *fpath*: string, path to the po file - *encoding*: string, the encoding to use, defaults to "default_encoding" global variable (optional), - *check_for_duplicates*: whether to check for duplicate entries when adding entries to the file, defa... | 447,207 |
def __init__(self, fpath, enc=default_encoding): """_MOFileParser constructor.""" self.fhandle = open(fpath, 'rb') self.instance = MOFile(fpath=fpath, encoding=enc) | def __init__(self, fpath, enc=default_encoding): """_MOFileParser constructor.""" self.fhandle = open(fpath, 'rb') self.instance = MOFile(fpath=fpath, encoding=enc) | 447,208 |
def parse(self): """ Build the instance with the file handle provided in the constructor. """ magic_number = self._readbinary('<I', 4) if magic_number == self.LITTLE_ENDIAN: ii = '<II' elif magic_number == self.BIG_ENDIAN: ii = '>II' else: raise IOError('Invalid mo file, magic number is incorrect !') self.instance.magi... | def parse(self): """ Build the instance with the file handle provided in the constructor. """ magic_number = self._readbinary('<I', 4) if magic_number == self.LITTLE_ENDIAN: ii = '<II' elif magic_number == self.BIG_ENDIAN: ii = '>II' else: raise IOError('Invalid mo file, magic number is incorrect !') self.instance.magi... | 447,209 |
def test(f): if f.endswith('po'): p = pofile(f) else: p = mofile(f) s = str(p) | def test(f): if f.endswith('po'): p = pofile(f) else: p = mofile(f) s = str(p) | 447,210 |
def scanRepository(self): console.info("Scanning %s" %self.dir) console.indent() 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... | def scanRepository(self): console.info("Scanning %s" %self.dir) console.indent() 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... | 447,211 |
def removeBOM(fpath): content = open(fpath, "rb").read() if content.startswith(codecs.BOM_UTF8): self._console.debug("removing BOM: %s" % filePath) open(fpath, "wb").write(content[len(codecs.BOM_UTF8):]) return | def removeBOM(fpath): content = open(fpath, "rb").read() if content.startswith(codecs.BOM_UTF8): self._console.debug("removing BOM: %s" % filePath) open(fpath, "wb").write(content[len(codecs.BOM_UTF8):]) return | 447,212 |
def getPackageStrings(self, content, variants): """ combines data from multiple classes into one map """ | def getPackageStrings(self, content, variants): """ combines data from multiple classes into one map """ | 447,213 |
def _handleCode(script): filetool.directory("./provider/code") for clazz in script.classes: classId = clazz.replace(".","/") + ".js" filetool.directory("provider/code/"+os.path.dirname(classId)) shutil.copy("source/class/"+classId, "provider/code/"+classId) return | def _handleCode(script): approot = context.jobconf.get("provider/app-root", "./provider") filetool.directory(approot + "/code") for clazz in script.classes: classId = clazz.replace(".","/") + ".js" filetool.directory("provider/code/"+os.path.dirname(classId)) shutil.copy("source/class/"+classId, "provider/code/"+classI... | 447,214 |
def _handleCode(script): filetool.directory("./provider/code") for clazz in script.classes: classId = clazz.replace(".","/") + ".js" filetool.directory("provider/code/"+os.path.dirname(classId)) shutil.copy("source/class/"+classId, "provider/code/"+classId) return | def _handleCode(script): filetool.directory("./provider/code") for clazz in script.classes: classId = clazz.replace(".","/") + ".js" filetool.directory(approot+"/code/"+os.path.dirname(classId)) shutil.copy("source/class/"+classId, approot+"/code/"+classId) return | 447,215 |
def createResourceInfo(res, resval): resinfo = [ { "target": "resource", "data": { res : resval }} ] filetool.save("provider/data/resource/" + res + ".json", json.dumpsCode(resinfo)) return | def createResourceInfo(res, resval): resinfo = [ { "target": "resource", "data": { res : resval }} ] filetool.save(approot+"/data/resource/" + res + ".json", json.dumpsCode(resinfo)) return | 447,216 |
def copyResource(res): filetool.directory("provider/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, "provider/resource/"+res) return | def copyResource(res): filetool.directory(approot+"/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, approot+"/resource/"+res) return | 447,217 |
def copyResource(res): filetool.directory("provider/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, "provider/resource/"+res) return | def copyResource(res): filetool.directory("provider/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, "provider/resource/"+res) return | 447,218 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") console.indent() buildQueue = {} for libraryName, library in self.children.iteritems(): libraryQueue = library.buildAllDem... | def buildAllDemos(self, buildTarget="build"): console.info("Generating demos for all known libraries") console.indent() buildQueue = {} for libraryName, library in self.children.iteritems(): libraryQueue = library.buildAllDemos(buildTarget, demoBrowser, copyDemos) for qxVersion, jobData in libraryQueue.iteritems(): if... | 447,219 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") console.indent() buildQueue = {} for libraryName, library in self.children.iteritems(): libraryQueue = library.buildAllDem... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): if demoBrowser: demoBrowser = os.path.abspath(demoBrowser) console.info("Generating demos for all known libraries") console.indent() buildQueue = {} for libraryName, library in self.children.iteritems(): libraryQueue = library.buildAllDem... | 447,220 |
def runGeneratorForAll(self, job, cwd=False): console.indent() for libraryName, library in self.children.iteritems(): for versionName, libraryVersion in library.children.iteritems(): console.info("Running job %s on %s %s..." %(job, libraryName, versionName)) ret, out, err = runGenerator(libraryVersion.path, job, cwd) c... | def runGeneratorForAll(self, job, macro=False): console.indent() for libraryName, library in self.children.iteritems(): for versionName, libraryVersion in library.children.iteritems(): console.info("Running job %s on %s %s..." %(job, libraryName, versionName)) ret, out, err = runGenerator(libraryVersion.path, job, cwd)... | 447,221 |
def runGeneratorForAll(self, job, cwd=False): console.indent() for libraryName, library in self.children.iteritems(): for versionName, libraryVersion in library.children.iteritems(): console.info("Running job %s on %s %s..." %(job, libraryName, versionName)) ret, out, err = runGenerator(libraryVersion.path, job, cwd) c... | def runGeneratorForAll(self, job, cwd=False): console.indent() for libraryName, library in self.children.iteritems(): for versionName, libraryVersion in library.children.iteritems(): console.info("Running job %s on %s %s..." %(job, libraryName, versionName)) ret, out, err = runGenerator(libraryVersion.path, job, macro)... | 447,222 |
def runGeneratorForAll(self, job, cwd=False): console.indent() for libraryName, library in self.children.iteritems(): for versionName, libraryVersion in library.children.iteritems(): console.info("Running job %s on %s %s..." %(job, libraryName, versionName)) ret, out, err = runGenerator(libraryVersion.path, job, cwd) c... | def runGeneratorForAll(self, job, cwd=False): console.indent() for libraryName, library in self.children.iteritems(): for versionName, libraryVersion in library.children.iteritems(): console.info("Running job %s on %s %s..." %(job, libraryName, versionName)) ret, out, err = runGenerator(libraryVersion.path, job, cwd) c... | 447,223 |
def buildAllDemos(self, buildTarget, demoBrowser, copyDemos): buildQueue = {} for versionName, version in self.children.iteritems(): versionQueue = version.buildAllDemos(buildTarget, demoBrowser, copyDemos) for qxVersion, jobData in versionQueue.iteritems(): if not qxVersion in buildQueue: buildQueue[qxVersion] = [] bu... | def buildAllDemos(self, buildTarget): buildQueue = {} for versionName, version in self.children.iteritems(): versionQueue = version.buildAllDemos(buildTarget, demoBrowser, copyDemos) for qxVersion, jobData in versionQueue.iteritems(): if not qxVersion in buildQueue: buildQueue[qxVersion] = [] buildQueue[qxVersion].exte... | 447,224 |
def buildAllDemos(self, buildTarget, demoBrowser, copyDemos): buildQueue = {} for versionName, version in self.children.iteritems(): versionQueue = version.buildAllDemos(buildTarget, demoBrowser, copyDemos) for qxVersion, jobData in versionQueue.iteritems(): if not qxVersion in buildQueue: buildQueue[qxVersion] = [] bu... | def buildAllDemos(self, buildTarget, demoBrowser, copyDemos): buildQueue = {} for versionName, version in self.children.iteritems(): versionQueue = version.buildAllDemos(buildTarget) for qxVersion, jobData in versionQueue.iteritems(): if not qxVersion in buildQueue: buildQueue[qxVersion] = [] buildQueue[qxVersion].exte... | 447,225 |
def __init__(self, name, path, library): self.name = name self.path = path self.parent = library self.manifest = self._getManifest() self.issues = [] self.readme = self._getReadme() self.data = { "classname" : self.name, "tests" : [], "manifest" : self.manifest, "readme" : self.readme } self._checkStructure() self.ch... | def __init__(self, name, path, library): self.name = name self.path = path self.parent = library self.manifest = self._getManifest() self.issues = [] self.readme = self._getReadme() self.data = { "classname" : self.name, "tests" : [], "manifest" : self.manifest, "readme" : self.readme, "jobsExecuted" : [] } self._chec... | 447,226 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): buildQueue = {} qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible... | def buildAllDemos(self, buildTarget="build"): if options.demobrowser: demoBrowser = os.path.abspath(options.demobrowser) else: demoBrowser = None buildQueue = {} qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatib... | 447,227 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): buildQueue = {} qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): buildQueue = {} qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible... | 447,228 |
def runBuildJob(jobData, qxVersion): variant = jobData[0] buildTarget = jobData[1] macro = jobData[2] demoBrowser = jobData[3] console.info("Generating %s version of demo variant %s for library %s version %s..." %(buildTarget, variant.name, variant.parent.parent.name, variant.parent.name) ) variant.build(buildTarget, m... | def runBuildJob(jobData, qxVersion): variant = jobData[0] buildTarget = jobData[1] macro = jobData[2] if options.demobrowser: demoBrowser = os.path.abspath(options.demobrowser) else: demoBrowser = False console.info("Generating %s version of demo variant %s for library %s version %s..." %(buildTarget, variant.name, v... | 447,229 |
def runBuildJob(jobData, qxVersion): variant = jobData[0] buildTarget = jobData[1] macro = jobData[2] demoBrowser = jobData[3] console.info("Generating %s version of demo variant %s for library %s version %s..." %(buildTarget, variant.name, variant.parent.parent.name, variant.parent.name) ) variant.build(buildTarget, m... | def runBuildJob(jobData, qxVersion): variant = jobData[0] buildTarget = jobData[1] macro = jobData[2] demoBrowser = jobData[3] console.info("Generating %s version of demo variant %s for library %s version %s..." %(buildTarget, variant.name, variant.parent.parent.name, variant.parent.name) ) variant.build(buildTarget, m... | 447,230 |
def main(): (options,args) = getComputedConf() config = None if options.configfile: config = getDataFromJsonFile(options.configfile) repository = Repository(options.workdir, config) if options.demobrowser: if not os.path.isabs(options.demobrowser): options.demobrowser = os.path.abspath(options.demobrowser) if optio... | def main(): (options,args) = getComputedConf() config = None if options.configfile: config = getDataFromJsonFile(options.configfile) repository = Repository(options.workdir, config) if options.demobrowser: if not os.path.isabs(options.demobrowser): options.demobrowser = os.path.abspath(options.demobrowser) if optio... | 447,231 |
def main(): (options,args) = getComputedConf() config = None if options.configfile: config = getDataFromJsonFile(options.configfile) repository = Repository(options.workdir, config) if options.demobrowser: if not os.path.isabs(options.demobrowser): options.demobrowser = os.path.abspath(options.demobrowser) if optio... | def main(): (options,args) = getComputedConf() config = None if options.configfile: config = getDataFromJsonFile(options.configfile) repository = Repository(options.workdir, config) if options.demobrowser: if not os.path.isabs(options.demobrowser): options.demobrowser = os.path.abspath(options.demobrowser) if optio... | 447,232 |
def buildShallowDeps(): | def buildShallowDeps(): | 447,233 |
def getOptionals(self, includeWithDeps): result = [] | def getOptionals(self, includeWithDeps): result = [] | 447,234 |
def getTransitiveDeps(self, depsItem, variants): | def getTransitiveDeps(self, depsItem, variants): | 447,235 |
def getTransitiveDepsR(dependencyItem, variants, totalDeps): | def getTransitiveDepsR(dependencyItem, variants, totalDeps): | 447,236 |
def getTransitiveDepsR(dependencyItem, variants, totalDeps): | def getTransitiveDepsR(dependencyItem, variants, totalDeps): | 447,237 |
def writeI18NFiles(self, globalCodes, script): | def writeI18NFiles(self, globalCodes, script): | 447,238 |
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! if len(t) < 5: code = t[2] else: code = t[3] res = "::\n\n" res += reindentBlock(code, 4) res += "\n" retu... | 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! if len(t) < 5: code = t[2] else: code = t[3] res = "\n::\n\n" res += reindentBlock(code, 4) res += "\n" re... | 447,239 |
def main(path): assert(os.path.isdir(path)) for root,dirs,files in os.walk(path): for file in (f for f in files if f.endswith(".txt")): transform(os.path.join(root,file)) | def main(path): assert(os.path.isdir(path)) for root,dirs,files in os.walk(path): for file in (f for f in files if f.endswith(".txt")): transform(os.path.join(root,file)) | 447,240 |
def buildShallowDeps(): | def buildShallowDeps(): | 447,241 |
def analyzeClassTree(variantSet): | defanalyzeClassTree(variantSet): | 447,242 |
def mergeTranslationMaps(transMaps): poData = {} cldrData = {} | def mergeTranslationMaps(transMaps): poData = {} cldrData = {} | 447,243 |
def __init__(self, repoDir, processLibs = None): global console console = Log(None, "info") global shell shell = ShellCmd() self.dir = repoDir self.libraries = self.getLibraries(processLibs) | """Represents a repository containing qooxdoo libraries.""" 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, a dictionary containing library/directory names as keys and a list... | 447,244 |
def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | 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 and name[0] != ".": if processLibs: # only process selected libraries if name i... | 447,245 |
def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries... | 447,246 |
def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | def getLibraries(self, processLibs = None): 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 if proce... | 447,247 |
def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | 447,248 |
def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | def getLibraries(self, processLibs = None): 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 and name[0] != ".": if processLibs: # only process selected libraries if... | 447,249 |
def buildAllDemos(self): for libraryName in self.libraries: library = self.libraries[libraryName] for versionName in library.versions: version = library.versions[versionName] if version.hasDemoDir: demoVariants = version.getDemoVariants() if demoVariants: for variant in demoVariants: version.buildDemo(variant) | def buildAllDemos(self, selectedVariant=None): demoData = [] if self.config: if "demobrowser" in self.config: demoBrowser = True for libraryName in self.libraries: library = self.libraries[libraryName] for versionName in library.versions: version = library.versions[versionName] if version.hasDemoDir: demoVariants = ve... | 447,250 |
def buildAllDemos(self): for libraryName in self.libraries: library = self.libraries[libraryName] for versionName in library.versions: version = library.versions[versionName] if version.hasDemoDir: demoVariants = version.getDemoVariants() if demoVariants: for variant in demoVariants: version.buildDemo(variant) | def buildAllDemos(self): for libraryName in self.libraries: library = self.libraries[libraryName] for versionName in library.versions: version = library.versions[versionName] if version.hasDemoDir: demoVariants = version.getDemoVariants() if demoVariants: for variant in demoVariants: version.buildDemo(variant) | 447,251 |
def __init__(self, repository = None, libraryDir = None, libraryVersions = [] ): if not (libraryDir and repository): raise RuntimeError, "Repository and library directory must be defined!" self.repository = repository self.dir = libraryDir self.versions = self.getVersions(libraryVersions) | def__init__(self,repository=None,libraryDir=None,libraryVersions=[]):ifnot(libraryDirandrepository):raiseRuntimeError,"Repositoryandlibrarydirectorymustbedefined!"self.repository=repositoryself.dir=libraryDirself.versions=self.getVersions(libraryVersions) | 447,252 |
def getVersions(self, libraryVersions): versions = {} libraryPath = os.path.join(self.repository.dir, self.dir) for root, dirs, files in os.walk(libraryPath, topdown=True): for name in dirs: console.indent() # only check direct subfolders of the library, ignore .svn etc. if root == libraryPath and name[0] != ".": # onl... | def getVersions(self, libraryVersions): versions = {} libraryPath = os.path.join(self.repository.dir, self.dir) for root, dirs, files in os.walk(libraryPath, topdown=True): for name in dirs[:]: console.indent() # only check direct subfolders of the library, ignore .svn etc. if root == libraryPath and name[0] != ".": #... | 447,253 |
def getVersions(self, libraryVersions): versions = {} libraryPath = os.path.join(self.repository.dir, self.dir) for root, dirs, files in os.walk(libraryPath, topdown=True): for name in dirs: console.indent() # only check direct subfolders of the library, ignore .svn etc. if root == libraryPath and name[0] != ".": # onl... | def getVersions(self, libraryVersions): versions = {} libraryPath = os.path.join(self.repository.dir, self.dir) for root, dirs, files in os.walk(libraryPath, topdown=True): for name in dirs: console.indent() # only check direct subfolders of the library, ignore .svn etc. if root == libraryPath and name[0] != ".": # onl... | 447,254 |
def getVersions(self, libraryVersions): versions = {} libraryPath = os.path.join(self.repository.dir, self.dir) for root, dirs, files in os.walk(libraryPath, topdown=True): for name in dirs: console.indent() # only check direct subfolders of the library, ignore .svn etc. if root == libraryPath and name[0] != ".": # onl... | def getVersions(self, libraryVersions): versions = {} libraryPath = os.path.join(self.repository.dir, self.dir) for root, dirs, files in os.walk(libraryPath, topdown=True): for name in dirs: console.indent() # only check direct subfolders of the library, ignore .svn etc. if root == libraryPath and name[0] != ".": # onl... | 447,255 |
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.versionPath = os.path.join(self.library.repository.dir, self.library.dir, self.dir) self.manifest = sel... | 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.versionPath = os.path.join(self.library.repository.dir, self.library.dir, self.dir) self.manifest = sel... | 447,256 |
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.versionPath = os.path.join(self.library.repository.dir, self.library.dir, self.dir) self.manifest = sel... | 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.versionPath = os.path.join(self.library.repository.dir, self.library.dir, self.dir) try: self.manifest ... | 447,257 |
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.versionPath = os.path.join(self.library.repository.dir, self.library.dir, self.dir) self.manifest = sel... | 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.versionPath = os.path.join(self.library.repository.dir, self.library.dir, self.dir) self.manifest = sel... | 447,258 |
def mergeTranslationMaps(transMaps): poData = {} cldrData = {} | def mergeTranslationMaps(transMaps): poData = {} cldrData = {} | 447,259 |
def generateResourceInfoCode(self, script, settings, libs, format=False): | def generateResourceInfoCode(self, script, settings, libs, format=False): | 447,260 |
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... | 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... | 447,261 |
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... | 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... | 447,262 |
def clashProcess(): # check whether the local job is protected jobMap = self.getJobsMap() if ((Lang.OVERRIDE_KEY not in jobMap) or (l.clashname not in jobMap[Lang.OVERRIDE_KEY])): # put shaddowed job in the local 'extend' if not newJob: raise Error, "unsuitable new job" localjob = self.getJob(l.clashname) extList = loc... | def clashProcess(): # check whether the local job is protected jobMap = self.getJobsMap() if ((Lang.OVERRIDE_KEY not in jobMap) or (l.clashname not in jobMap[Lang.OVERRIDE_KEY])): # put shaddowed job in the local 'extend' if not newJob: raise Error, "unsuitable new job" localjob = self.getJob(l.clashname) extList = loc... | 447,263 |
def main(): copier = CopyTool() copier.parse_args() copier.copy() | def main(): copier = CopyTool() copier.parse_args() copier.do_work() | 447,264 |
def setUp(self): file("file1", "w") file("file2", "w") os.mkdir("dir1") os.mkdir("dir2") | def setUp(self): file("file1", "w") file("file2", "w") os.mkdir("dir1") os.mkdir("dir2") | 447,265 |
def testInvalidTarget(self): copier = CopyTool("file1", "file2") self.failUnlessRaises(Exception, copier.copy) | compare = filecmp.dircmp(sourceDir, targetPath) for entry in compare.left_only: if entry in self.exclude: continue entryPath = os.path.join(sourceDir, entry) if os.path.isfile(entryPath): self.__copyFileToDir(entryPath, targetPath) if os.path.isdir(entryPath): self.__copyDirToDir(entryPath, targetPath) | 447,266 |
def testFile(self): copier = CopyTool("file1", "dir1") copier.copy() self.failUnless(os.path.isfile(os.path.join("dir1", "file1")), "Source file was not copied to target directory!") | def testFile(self): copier = CopyTool("file1", "dir1") copier.copy() self.failUnless(os.path.isfile(os.path.join("dir1", "file1")), "Source file was not copied to target directory!") | 447,267 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | 447,268 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | 447,269 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | 447,270 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | 447,271 |
def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | def buildAllDemos(self, buildTarget="build", demoBrowser=None, copyDemos=False): qxVersions = self.manifest["info"]["qooxdoo-versions"] for variantName, variant in self.children.iteritems(): # build version: link demo against each compatible qooxdoo version if buildTarget == "build": #get the compatible qooxdoo version... | 447,272 |
def build(self, target="build", macro=None): console.info("Generating %s version of demo variant %s for library %s version %s..." %(target, self.name, self.parent.parent.name, self.parent.name) ) demoBuildStatus = {} try: rcode, output, errout = runGenerator(self.path, target, macro) except Exception, e: msg = "Error ... | def build(self, target="build", macro=None): console.info("Generating %s version of demo variant %s for library %s version %s..." %(target, self.name, self.parent.parent.name, self.parent.name) ) try: rcode, output, errout = runGenerator(self.path, target, macro) except Exception, e: msg = "Error running generator: " ... | 447,273 |
def build(self, target="build", macro=None): console.info("Generating %s version of demo variant %s for library %s version %s..." %(target, self.name, self.parent.parent.name, self.parent.name) ) demoBuildStatus = {} try: rcode, output, errout = runGenerator(self.path, target, macro) except Exception, e: msg = "Error ... | def build(self, target="build", macro=None): console.info("Generating %s version of demo variant %s for library %s version %s..." %(target, self.name, self.parent.parent.name, self.parent.name) ) demoBuildStatus = {} try: rcode, output, errout = runGenerator(self.path, target, macro) except Exception, e: msg = "Error ... | 447,274 |
def build(self, target="build", macro=None): console.info("Generating %s version of demo variant %s for library %s version %s..." %(target, self.name, self.parent.parent.name, self.parent.name) ) demoBuildStatus = {} try: rcode, output, errout = runGenerator(self.path, target, macro) except Exception, e: msg = "Error ... | def build(self, target="build", macro=None): console.info("Generating %s version of demo variant %s for library %s version %s..." %(target, self.name, self.parent.parent.name, self.parent.name) ) demoBuildStatus = {} try: rcode, output, errout = runGenerator(self.path, target, macro) except Exception, e: msg = "Error ... | 447,275 |
def splitClassAttribute(assembledId, assembled): if assembledId == assembled: # just a class id clazzId = assembledId attribute = u'' else: clazzId = assembledId attribute = assembled[ len(assembledId) +1 :] # a.b.c.d = a.b.c + '.' + d return clazzId, attribute | def splitClassAttribute(assembledId, assembled): if assembledId == assembled: # just a class id clazzId = assembledId attribute = u'' else: clazzId = assembledId attribute = assembled[ len(assembledId) +1 :] # a.b.c.d = a.b.c + '.' + d return clazzId, attribute | 447,276 |
def createPoFile(self): po = polib.POFile() now = util.nowString() | def createPoFile(self): po = polib.POFile() now = util.nowString() | 447,277 |
def getRemoteRevision(self): import urllib, re remoteFile = self.autConf['autHost'] if 'autQxPath' in self.autConf: remoteFile += self.autConf['autQxPath'] remoteFile += '/revision.txt' try: rev = urllib.urlopen(remoteFile).read() except IOError, e: self.log("ERROR: Unable to open remote revision file " + remoteFile + ... | def getRemoteRevision(self): import urllib, re remoteFile = self.autConf['autHost'] if 'autQxPath' in self.autConf: remoteFile += self.autConf['autQxPath'] remoteFile += '/revision.txt' try: rev = urllib.urlopen(remoteFile).read() except IOError, e: self.log("ERROR: Unable to open remote revision file " + remoteFile + ... | 447,278 |
def getRemoteRevision(self): import urllib, re remoteFile = self.autConf['autHost'] if 'autQxPath' in self.autConf: remoteFile += self.autConf['autQxPath'] remoteFile += '/revision.txt' try: rev = urllib.urlopen(remoteFile).read() except IOError, e: self.log("ERROR: Unable to open remote revision file " + remoteFile + ... | def getRemoteRevision(self): import urllib, re remoteFile = self.autConf['autHost'] if 'autQxPath' in self.autConf: remoteFile += self.autConf['autQxPath'] remoteFile += '/revision.txt' try: rev = urllib.urlopen(remoteFile).read() except IOError, e: self.log("ERROR: Unable to open remote revision file " + remoteFile + ... | 447,279 |
def generateResourceInfoCode(self, script, settings, libs, format=False): """Pre-calculate image information (e.g. sizes)""" | def generateResourceInfoCode(self, script, settings, libs, format=False): """Pre-calculate image information (e.g. sizes)""" | 447,280 |
def extractAssetPart(libresuri, imguri): pre,libsfx,imgsfx = Path.getCommonPrefix(libresuri, imguri) # split libresuri from imguri if imgsfx[0] == os.sep: imgsfx = imgsfx[1:] # strip leading '/' return imgsfx # use the bare img suffix as its asset Id | defextractAssetPart(libresuri,imguri):pre,libsfx,imgsfx=Path.getCommonPrefix(libresuri,imguri)#splitlibresurifromimguriifimgsfx[0]==os.sep:imgsfx=imgsfx[1:]#stripleading'/'returnimgsfx#usethebareimgsuffixasitsassetId | 447,281 |
def normalizeImgUri(uriFromMetafile, trueCombinedUri, combinedUriFromMetafile): # normalize paths (esp. "./x" -> "x") (uriFromMetafile, trueCombinedUri, combinedUriFromMetafile) = map(os.path.normpath, (uriFromMetafile, trueCombinedUri, combinedUriFromMetafile)) # get the "wrong" left part of the combined image, as use... | defnormalizeImgUri(uriFromMetafile,trueCombinedUri,combinedUriFromMetafile):#normalizepaths(esp."./x"->"x")(uriFromMetafile,trueCombinedUri,combinedUriFromMetafile)=map(os.path.normpath,(uriFromMetafile,trueCombinedUri,combinedUriFromMetafile))#getthe"wrong"leftpartofthecombinedimage,asusedinthe.metafile(inmappedUriPre... | 447,282 |
def processCombinedImg(script, data, meta_fname, combinedImageUri, combinedImageShortUri, combinedImageObject): # make sure lib and type info for the combined image are present assert combinedImageObject.lib, combinedImageObject.type | def processCombinedImg(script, data, meta_fname, combinedImageUri, combinedImageShortUri, combinedImageObject): # make sure lib and type info for the combined image are present assert combinedImageObject.lib, combinedImageObject.type | 447,283 |
def processCombinedImg(script, data, meta_fname, combinedImageUri, combinedImageShortUri, combinedImageObject): # make sure lib and type info for the combined image are present assert combinedImageObject.lib, combinedImageObject.type | def processCombinedImg(script, data, meta_fname, combinedImageUri, combinedImageShortUri, combinedImageObject): # make sure lib and type info for the combined image are present assert combinedImageObject.lib, combinedImageObject.type | 447,284 |
def processCombinedImg(script, data, meta_fname, combinedImageUri, combinedImageShortUri, combinedImageObject): # make sure lib and type info for the combined image are present assert combinedImageObject.lib, combinedImageObject.type | defprocessCombinedImg(script,data,meta_fname,combinedImageUri,combinedImageShortUri,combinedImageObject):#makesurelibandtypeinfoforthecombinedimagearepresentassertcombinedImageObject.lib,combinedImageObject.type | 447,285 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | 447,286 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | 447,287 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | defaddResourceToPackage(script,classToResourceMap,assetId,resvalue):classesUsing=set(())forclazz,assetSetinclassToResourceMap.items():forassetRexinassetSet:ifassetRex.match(assetId):classesUsing.add(clazz)breakforpackageinscript.packages:ifclassesUsing.intersection(set(package.classes)):package.data.resources[assetId]=... | 447,288 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | 447,289 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | 447,290 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | 447,291 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | defaddResourceToPackage(script,classToResourceMap,assetId,resvalue):classesUsing=set(())forclazz,assetSetinclassToResourceMap.items():forassetRexinassetSet:ifassetRex.match(assetId):classesUsing.add(clazz)breakforpackageinscript.packages:ifclassesUsing.intersection(set(package.classes)):package.data.resources[assetId]=... | 447,292 |
def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | def addResourceToPackage(script, classToResourceMap, assetId, resvalue): classesUsing = set(()) for clazz, assetSet in classToResourceMap.items(): for assetRex in assetSet: if assetRex.match(assetId): classesUsing.add(clazz) break for package in script.packages: if classesUsing.intersection(set(package.classes)): packa... | 447,293 |
def _copyResources(self, srcPath, targPath): # targPath *has* to be directory -- there is now way of telling a # non-existing target file from a non-existing target directory :-) generator = self #generator._console.debug("_copyResource: %s => %s" % (srcPath, targPath)) copier = copytool.CopyTool(generator._console) a... | def _copyResources(self, srcPath, targPath): # targPath *has* to be directory -- there is now way of telling a # non-existing target file from a non-existing target directory :-) generator = self #generator._console.debug("_copyResource: %s => %s" % (srcPath, targPath)) copier = robocopy.PyRobocopier(generator._cons... | 447,294 |
def patchFeature(job, key, renamedJobs): newlist = [] oldlist = job.getFeature(key) for jobentry in oldlist: if (isinstance(jobentry, types.StringTypes) and jobentry in renamedJobs): newlist.append(renamedJobs[jobentry]) else: newlist.append(jobentry) job.setFeature(key, newlist) | def patchJobReferences(job, key, renamedJobs): newlist = [] oldlist = job.getFeature(key) for jobentry in oldlist: if (isinstance(jobentry, types.StringTypes) and jobentry in renamedJobs): newlist.append(renamedJobs[jobentry]) else: newlist.append(jobentry) job.setFeature(key, newlist) | 447,295 |
def patchFeature(job, key, renamedJobs): newlist = [] oldlist = job.getFeature(key) for jobentry in oldlist: if (isinstance(jobentry, types.StringTypes) and jobentry in renamedJobs): newlist.append(renamedJobs[jobentry]) else: newlist.append(jobentry) job.setFeature(key, newlist) | def patchFeature(job, key, renamedJobs): newlist = [] oldlist = job.getFeature(key) for jobentry in oldlist: if (isinstance(jobentry, types.StringTypes) and jobentry in renamedJobs): newlist.append(renamedJobs[jobentry]) else: newlist.append(jobentry) job.setFeature(key, newlist) | 447,296 |
def __init__(self, logFile, ignoreStrings=[]): 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 = [] for string in ignoreStrings: reg = re.compile(string) self.ignore.append(reg) ... | 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 = [] for string in ignoreStrings: reg = re.compile(string) self.ignore.append(reg... | 447,297 |
def __init__(self, logFile, ignoreStrings=[]): 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 = [] for string in ignoreStrings: reg = re.compile(string) self.ignore.append(reg) ... | def __init__(self, logFile, ignoreStrings=[]): 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: reg = re.compile(string) self... | 447,298 |
def getLogentryList(self, logEntries): logentryList = [] for entry in logEntries: ignore = False 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 "level-error" in ... | 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 "... | 447,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.