How to use the elementtree.ElementTree function in elementtree

To help you get started, we’ve selected a few elementtree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-lib / cordova-lib / spec-cordova / metadata / wp8_parser.spec.js View on Github external
spyOn(xmlHelpers, 'parseElementtreeSync').and.callFake(function(path) {
            if (/WMAppManifest.xml$/.exec(path)) {
                return manifestXml = new et.ElementTree(et.XML(MANIFEST_XML));
            } else if (/csproj$/.exec(path)) {
                return projXml = new et.ElementTree(et.XML(PROJ_XML));
            } else if (/MainPage.xaml$/.exec(path)) {
                return mainPageXamlXml = new et.ElementTree(et.XML(MAINPAGEXAML_XML));
            } else if (/xaml$/.exec(path)) {
                return new et.ElementTree(et.XML(XAML_XML));
            } else {
                throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
            }
        });
    });
github apache / cordova-lib / cordova-lib / spec-cordova / metadata / android_parser.spec.js View on Github external
spyOn(xmlHelpers, 'parseElementtreeSync').and.callFake(function(path) {
                if (/strings/.exec(path)) {
                    return stringsRoot = new et.ElementTree(et.XML(STRINGS_XML));
                } else if (/AndroidManifest/.exec(path)) {
                    return manifestRoot = new et.ElementTree(et.XML(MANIFEST_XML));
                } else {
                    throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
                }
            });
            getOrientation = spyOn(p.helper, 'getOrientation');
github apache / cordova-lib / cordova-lib / spec-cordova / metadata / wp7_parser.spec.js View on Github external
spyOn(xmlHelpers, 'parseElementtreeSync').andCallFake(function(path) {
            if (/WMAppManifest.xml$/.exec(path)) {
                return manifestXml = new et.ElementTree(et.XML(''));
            } else if (/csproj$/.exec(path)) {
                return projXml = new et.ElementTree(et.XML(''));
            } else if (/xaml$/.exec(path)) {
                return new et.ElementTree(et.XML(''));
            } else {
                throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
            }
        });
    });
github apache / cordova-lib / cordova-lib / spec-cordova / metadata / wp8_parser.spec.js View on Github external
spyOn(xmlHelpers, 'parseElementtreeSync').andCallFake(function(path) {
            if (/WMAppManifest.xml$/.exec(path)) {
                return manifestXml = new et.ElementTree(et.XML(''));
            } else if (/csproj$/.exec(path)) {
                return projXml = new et.ElementTree(et.XML(''));
            } else if (/xaml$/.exec(path)) {
                return new et.ElementTree(et.XML(''));
            } else {
                throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
            }
        });
    });
github SpiderOak / SpiderOakMobileClient / .cordova / hooks / before_prepare / version.js View on Github external
(function(require, console) {
  var projectName = 'SpiderOak',
    fs = require('fs'),
    path = require('path'),
    et = require('elementtree'),
    shell = require('shelljs'),
    projectRootDir = path.resolve(__dirname, '..', '..', '..'),
    configPath = path.join(projectRootDir, 'www', 'config.xml');

  var doc = new et.ElementTree(et.XML(fs.readFileSync(configPath, 'utf-8')));
  doc.getroot().attrib.version =
    shell.exec('git describe --tags', {silent:true}).output.trim();
  fs.writeFileSync(configPath, doc.write({indent: 4}), 'utf-8');


})(require, console);

elementtree

XML Serialization and Parsing module based on Python's ElementTree.

Apache-2.0
Latest version published 8 years ago

Package Health Score

56 / 100
Full package analysis