Package org.python.pydev.core.docutils

Examples of org.python.pydev.core.docutils.StringSubstitution


        String[] res = DebugPlugin.parseArguments(arguments);
        return res;
    }

    private static StringSubstitution getStringSubstitution(IPythonNature nature) {
        return new StringSubstitution(nature);
    }
View Full Code Here


                }
                String value = (String) entry.getValue();
                // translate any string substitution variables
                String translated = value;
                try {
                    StringSubstitution stringSubstitution = new StringSubstitution(nature);
                    translated = stringSubstitution.performStringSubstitution(value, false);
                } catch (Exception e) {
                    Log.log(e);
                }
                env.put(key, translated);
            }
View Full Code Here

        if (project == null || nature == null) {
            return "";
        }

        //Substitute with variables!
        StringSubstitution stringSubstitution = new StringSubstitution(nature);

        source = getProjectSourcePath(true);
        if (addExternal) {
            external = getProjectExternalSourcePath(true);
        }
        contributed = stringSubstitution.performPythonpathStringSubstitution(getContributedSourcePath(project));

        if (source == null) {
            source = "";
        }
        //we have to work on this one to resolve to full files, as what is stored is the position
View Full Code Here

     */
    private String trimAndReplaceVariablesIfNeeded(boolean replace, String projectSourcePath, PythonNature nature)
            throws CoreException {
        String ret = StringUtils.leftAndRightTrim(projectSourcePath, '|');
        if (replace) {
            StringSubstitution substitution = new StringSubstitution(nature);
            ret = substitution.performPythonpathStringSubstitution(ret);
        }
        return ret;
    }
View Full Code Here

        String path = fMainModuleText.getText();
        IFile file = null;
        if (path.length() > 0) {
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

            StringSubstitution stringSubstitution = getStringSubstitution(root);
            try {
                path = stringSubstitution.performStringSubstitution(path, false);
                IFile[] files = root.findFilesForLocationURI(new File(path).toURI());
                if (files.length > 0) {
                    file = files[0];
                }
            } catch (CoreException e) {
View Full Code Here

        IPythonNature nature = null;
        if (resource instanceof IProject) {
            nature = PythonNature.getPythonNature(resource);
        }

        StringSubstitution stringSubstitution = new StringSubstitution(nature);
        return stringSubstitution;
    }
View Full Code Here

        if (result) {
            setMessage(null);
            setErrorMessage(null);

            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            StringSubstitution stringSubstitution = getStringSubstitution(root);

            String location = fMainModuleText.getText();
            try {

                String identifier = launchConfig.getType().getIdentifier();
                if (identifier.equals(Constants.ID_PYTHON_UNITTEST_LAUNCH_CONFIGURATION_TYPE)
                        || identifier.equals(Constants.ID_JYTHON_UNITTEST_LAUNCH_CONFIGURATION_TYPE)
                        || identifier.equals(Constants.ID_IRONPYTHON_UNITTEST_LAUNCH_CONFIGURATION_TYPE)
                        || identifier.equals(Constants.ID_PYTHON_COVERAGE_LAUNCH_CONFIGURATION_TYPE)) {

                    //may have  multiple files selected for the run for unitest and code-coverage
                    for (String loc : StringUtils.splitAndRemoveEmptyTrimmed(location, '|')) {
                        String expandedLocation = stringSubstitution.performStringSubstitution(loc);
                        File file = new File(expandedLocation);
                        if (!file.exists()) {
                            setErrorMessage(com.aptana.shared_core.string.StringUtils.format("The file \"%s\" does not exist.", file));
                            result = false;
                            break;
                        }

                    }
                } else {
                    String expandedLocation = stringSubstitution.performStringSubstitution(location);
                    File file = new File(expandedLocation);
                    if (!file.exists()) {
                        setErrorMessage(com.aptana.shared_core.string.StringUtils.format("The file \"%s\" does not exist.", file));
                        result = false;
View Full Code Here

    protected IContainer getContainer() {
        String path = getWorkingDirectoryText();
        if (path.length() > 0) {
            IResource res = null;
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            StringSubstitution stringSubstitution = this.mainModuleTab.fMainModuleBlock.getStringSubstitution(root);
            try {
                path = stringSubstitution.performStringSubstitution(path, false);
                IContainer[] containers = root.findContainersForLocation(new Path(path));
                if (containers.length > 0) {
                    res = containers[0];
                }
            } catch (CoreException e) {
View Full Code Here

TOP

Related Classes of org.python.pydev.core.docutils.StringSubstitution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.