summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/ScriptBinding.py
Commit message (Expand)AuthorAgeFilesLines
* #13506 Add '' to path for interactive interpreter by adding with_cwd parameterTerry Jan Reedy2012-01-311-3/+2
* Issue #9871: Prevent IDLE 3 crash when given byte stingsNed Deily2011-09-141-4/+4
* IDLE: fix some RessourceWarning, reuse tokenize.open()Victor Stinner2011-09-011-19/+14
* Fixes #11088: IDLE crashes when using F5 to run a script on OSX with Tk 8.5Ronald Oussoren2011-05-171-1/+18
* Issue #11896: Save on Close failed despite selecting "Yes" in dialog.Kurt B. Kaiser2011-05-121-9/+7
* Merged revisions 88234 via svnmerge fromNed Deily2011-01-291-2/+2
* Issue #4008: Fix problems with non-ASCII source files.Martin v. Löwis2009-01-181-8/+14
* Tkinter, step 2: adapt imports.Georg Brandl2008-05-171-1/+1
* Merged revisions 60481,60485,60489-60492,60494-60496,60498-60499,60501-60503,...Christian Heimes2008-02-161-6/+7
* Switch to absolute imports to support direct execution of modules. ManyKurt B. Kaiser2007-08-221-3/+3
* Replace file() with open()Kurt B. Kaiser2007-08-221-1/+1
* Merged revisions 56492-56752 via svnmerge fromGuido van Rossum2007-08-051-34/+18
* Merged revisions 56483-56491 via svnmerge fromMartin v. Löwis2007-07-221-2/+2
* Merged revisions 56443-56466 via svnmerge fromGuido van Rossum2007-07-201-2/+2
* SF patch 1631942 by Collin Winter:Guido van Rossum2007-01-101-3/+3
* Four months of trunk changes (including a few releases...)Thomas Wouters2006-12-131-6/+4
* Merged revisions 46753-51188 via svnmerge fromThomas Wouters2006-08-111-1/+4
* Revert previous code elimination, 'filename' is needed.Kurt B. Kaiser2005-08-231-2/+7
* 1. Mac line endings were incorrect when pasting code from some browsersKurt B. Kaiser2005-08-231-7/+3
* 1. Clarify "tab/space" Error Dialog and "Tab Width" Dialog associated withKurt B. Kaiser2005-06-121-8/+5
* 1. Polish tabbing code.Kurt B. Kaiser2005-01-191-0/+2
* Redirect the warning stream to the shell during the ScriptBinding check of us...Kurt B. Kaiser2004-07-041-17/+23
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-3/+3
* Added a Tk error dialog to run.py inform the user if the subprocess can'tKurt B. Kaiser2004-01-211-0/+2
* SF 747667 Error Doesn't DecolorizeKurt B. Kaiser2003-06-051-1/+6
* SF 745525Kurt B. Kaiser2003-05-311-3/+14
* Whitespace NormalizationKurt B. Kaiser2003-05-261-1/+1
* Bruce Sherwood RFE/PatchKurt B. Kaiser2003-05-261-15/+27
* 1. Stake Freddy.Kurt B. Kaiser2003-05-241-11/+0
* 1. When a module is run from an EditorWindow, if its directory is not inKurt B. Kaiser2003-05-151-2/+3
* 1. Restore the capability to run and debug without a subprocess.Kurt B. Kaiser2003-05-151-3/+14
* M NEWS.txtKurt B. Kaiser2003-02-171-3/+0
* M ScriptBinding.pyKurt B. Kaiser2003-01-261-4/+4
* Default the OK key in the Save Before Run dialog.Kurt B. Kaiser2003-01-101-0/+1
* Whitespace NormalizationKurt B. Kaiser2002-12-311-2/+2
* If Edit window has not been saved, offer to save if user tries to Run orKurt B. Kaiser2002-12-191-14/+21
* M ColorDelegator.pyKurt B. Kaiser2002-12-171-21/+39
* Enable Check ModuleKurt B. Kaiser2002-12-031-5/+2
* Cleanup:Neal Norwitz2002-11-301-9/+5
* Merge Py Idle changes:Kurt B. Kaiser2002-09-181-2/+1
* M PyShell.pyKurt B. Kaiser2002-09-051-37/+7
* 1. Revert subprocess environment clearing, will restart subprocessKurt B. Kaiser2002-08-251-2/+0
* Reset the Python execution server environment to its initial value priorKurt B. Kaiser2002-07-281-1/+3
* Rework the code to have only the GvR RPC. Output from execution of userKurt B. Kaiser2002-06-121-8/+9
* GvR's rpc patchChui Tey2002-05-261-19/+36
* changeover to new keybinding configuration implementationSteven M. Gava2002-01-191-6/+0
* py-cvs merge, better error dialogSteven M. Gava2001-07-121-3/+7
* Initial revisionDavid Scherer2000-08-151-0/+169
hl opt">::string& path); static std::string EncodeDepfileSpace(const std::string& path); cmLinkLineComputer* CreateLinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir) const CM_OVERRIDE; /** * Write the given @a comment to the output stream @a os. It * handles new line character properly. */ static void WriteComment(std::ostream& os, const std::string& comment); /** * Utilized by the generator factory to determine if this generator * supports toolsets. */ static bool SupportsToolset() { return false; } /** * Utilized by the generator factory to determine if this generator * supports platforms. */ static bool SupportsPlatform() { return false; } /** * Write a build statement to @a os with the @a comment using * the @a rule the list of @a outputs files and inputs. * It also writes the variables bound to this build statement. * @warning no escaping of any kind is done here. */ void WriteBuild(std::ostream& os, const std::string& comment, const std::string& rule, const cmNinjaDeps& outputs, const cmNinjaDeps& implicitOuts, const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps, const cmNinjaDeps& orderOnlyDeps, const cmNinjaVars& variables, const std::string& rspfile = std::string(), int cmdLineLimit = 0, bool* usedResponseFile = CM_NULLPTR); /** * Helper to write a build statement with the special 'phony' rule. */ void WritePhonyBuild(std::ostream& os, const std::string& comment, const cmNinjaDeps& outputs, const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps = cmNinjaDeps(), const cmNinjaDeps& orderOnlyDeps = cmNinjaDeps(), const cmNinjaVars& variables = cmNinjaVars()); void WriteCustomCommandBuild(const std::string& command, const std::string& description, const std::string& comment, const std::string& depfile, bool uses_terminal, bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps = cmNinjaDeps(), const cmNinjaDeps& orderOnly = cmNinjaDeps()); void WriteMacOSXContentBuild(const std::string& input, const std::string& output); /** * Write a rule statement named @a name to @a os with the @a comment, * the mandatory @a command, the @a depfile and the @a description. * It also writes the variables bound to this rule statement. * @warning no escaping of any kind is done here. */ static void WriteRule(std::ostream& os, const std::string& name, const std::string& command, const std::string& description, const std::string& comment, const std::string& depfile, const std::string& deptype, const std::string& rspfile, const std::string& rspcontent, const std::string& restat, bool generator); /** * Write a variable named @a name to @a os with value @a value and an * optional @a comment. An @a indent level can be specified. * @warning no escaping of any kind is done here. */ static void WriteVariable(std::ostream& os, const std::string& name, const std::string& value, const std::string& comment = "", int indent = 0); /** * Write an include statement including @a filename with an optional * @a comment to the @a os stream. */ static void WriteInclude(std::ostream& os, const std::string& filename, const std::string& comment = ""); /** * Write a default target statement specifying @a targets as * the default targets. */ static void WriteDefault(std::ostream& os, const cmNinjaDeps& targets, const std::string& comment = ""); bool IsGCCOnWindows() const { return UsingGCCOnWindows; } public: cmGlobalNinjaGenerator(cmake* cm); static cmGlobalGeneratorFactory* NewFactory() { return new cmGlobalGeneratorSimpleFactory<cmGlobalNinjaGenerator>(); } ~cmGlobalNinjaGenerator() CM_OVERRIDE {} cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) CM_OVERRIDE; std::string GetName() const CM_OVERRIDE { return cmGlobalNinjaGenerator::GetActualName(); } static std::string GetActualName() { return "Ninja"; } /** Get encoding used by generator for ninja files */ codecvt::Encoding GetMakefileEncoding() const CM_OVERRIDE; static void GetDocumentation(cmDocumentationEntry& entry); void EnableLanguage(std::vector<std::string> const& languages, cmMakefile* mf, bool optional) CM_OVERRIDE; void GenerateBuildCommand(std::vector<std::string>& makeCommand, const std::string& makeProgram, const std::string& projectName, const std::string& projectDir, const std::string& targetName, const std::string& config, bool fast, bool verbose, std::vector<std::string> const& makeOptions = std::vector<std::string>()) CM_OVERRIDE; // Setup target names const char* GetAllTargetName() const CM_OVERRIDE { return "all"; } const char* GetInstallTargetName() const CM_OVERRIDE { return "install"; } const char* GetInstallLocalTargetName() const CM_OVERRIDE { return "install/local"; } const char* GetInstallStripTargetName() const CM_OVERRIDE { return "install/strip"; } const char* GetTestTargetName() const CM_OVERRIDE { return "test"; } const char* GetPackageTargetName() const CM_OVERRIDE { return "package"; } const char* GetPackageSourceTargetName() const CM_OVERRIDE { return "package_source"; } const char* GetEditCacheTargetName() const CM_OVERRIDE { return "edit_cache"; } const char* GetRebuildCacheTargetName() const CM_OVERRIDE { return "rebuild_cache"; } const char* GetCleanTargetName() const CM_OVERRIDE { return "clean"; } cmGeneratedFileStream* GetBuildFileStream() const { return this->BuildFileStream; } cmGeneratedFileStream* GetRulesFileStream() const { return this->RulesFileStream; } std::string ConvertToNinjaPath(const std::string& path) const; struct MapToNinjaPathImpl { cmGlobalNinjaGenerator* GG; MapToNinjaPathImpl(cmGlobalNinjaGenerator* gg) : GG(gg) { } std::string operator()(std::string const& path) { return this->GG->ConvertToNinjaPath(path); } }; MapToNinjaPathImpl MapToNinjaPath() { return MapToNinjaPathImpl(this); } void AddCXXCompileCommand(const std::string& commandLine, const std::string& sourceFile); /** * Add a rule to the generated build system. * Call WriteRule() behind the scene but perform some check before like: * - Do not add twice the same rule. */ void AddRule(const std::string& name, const std::string& command, const std::string& description, const std::string& comment, const std::string& depfile, const std::string& deptype, const std::string& rspfile, const std::string& rspcontent, const std::string& restat, bool generator); bool HasRule(const std::string& name); void AddCustomCommandRule(); void AddMacOSXContentRule(); bool HasCustomCommandOutput(const std::string& output) { return this->CustomCommandOutputs.find(output) != this->CustomCommandOutputs.end(); } /// Called when we have seen the given custom command. Returns true /// if we has seen it before. bool SeenCustomCommand(cmCustomCommand const* cc) { return !this->CustomCommands.insert(cc).second; } /// Called when we have seen the given custom command output. void SeenCustomCommandOutput(const std::string& output) { this->CustomCommandOutputs.insert(output); // We don't need the assumed dependencies anymore, because we have // an output. this->AssumedSourceDependencies.erase(output); } void AddAssumedSourceDependencies(const std::string& source, const cmNinjaDeps& deps) { std::set<std::string>& ASD = this->AssumedSourceDependencies[source]; // Because we may see the same source file multiple times (same source // specified in multiple targets), compute the union of any assumed // dependencies. ASD.insert(deps.begin(), deps.end()); } void AppendTargetOutputs(cmGeneratorTarget const* target, cmNinjaDeps& outputs); void AppendTargetDepends(cmGeneratorTarget const* target, cmNinjaDeps& outputs); void AppendTargetDependsClosure(cmGeneratorTarget const* target, cmNinjaDeps& outputs); void AddDependencyToAll(cmGeneratorTarget* target); void AddDependencyToAll(const std::string& input); const std::vector<cmLocalGenerator*>& GetLocalGenerators() const { return LocalGenerators; } bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) { return cmGlobalGenerator::IsExcluded(root, target); } int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; } void AddTargetAlias(const std::string& alias, cmGeneratorTarget* target); void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const CM_OVERRIDE; // Ninja generator uses 'deps' and 'msvc_deps_prefix' introduced in 1.3 static std::string RequiredNinjaVersion() { return "1.3"; } static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; } static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; } bool SupportsConsolePool() const; bool SupportsImplicitOuts() const; std::string NinjaOutputPath(std::string const& path) const; bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); } void StripNinjaOutputPathPrefixAsSuffix(std::string& path); bool WriteDyndepFile(std::string const& dir_top_src, std::string const& dir_top_bld, std::string const& dir_cur_src, std::string const& dir_cur_bld, std::string const& arg_dd, std::vector<std::string> const& arg_ddis, std::string const& module_dir, std::vector<std::string> const& linked_target_dirs); protected: void Generate() CM_OVERRIDE; bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const CM_OVERRIDE { return true; } private: std::string GetEditCacheCommand() const CM_OVERRIDE; bool FindMakeProgram(cmMakefile* mf) CM_OVERRIDE; void CheckNinjaFeatures(); bool CheckLanguages(std::vector<std::string> const& languages, cmMakefile* mf) const CM_OVERRIDE; bool CheckFortran(cmMakefile* mf) const; void OpenBuildFileStream(); void CloseBuildFileStream(); void CloseCompileCommandsStream(); void OpenRulesFileStream(); void CloseRulesFileStream(); /// Write the common disclaimer text at the top of each build file. void WriteDisclaimer(std::ostream& os); void WriteAssumedSourceDependencies(); void WriteTargetAliases(std::ostream& os); void WriteFolderTargets(std::ostream& os); void WriteUnknownExplicitDependencies(std::ostream& os); void WriteBuiltinTargets(std::ostream& os); void WriteTargetAll(std::ostream& os); void WriteTargetRebuildManifest(std::ostream& os); void WriteTargetClean(std::ostream& os); void WriteTargetHelp(std::ostream& os); void ComputeTargetDependsClosure( cmGeneratorTarget const* target, std::set<cmGeneratorTarget const*>& depends); std::string ninjaCmd() const; /// The file containing the build statement. (the relationship of the /// compilation DAG). cmGeneratedFileStream* BuildFileStream; /// The file containing the rule statements. (The action attached to each /// edge of the compilation DAG). cmGeneratedFileStream* RulesFileStream; cmGeneratedFileStream* CompileCommandsStream; /// The type used to store the set of rules added to the generated build /// system. typedef std::set<std::string> RulesSetType; /// The set of rules added to the generated build system. RulesSetType Rules; /// Length of rule command, used by rsp file evaluation std::map<std::string, int> RuleCmdLength; /// The set of dependencies to add to the "all" target. cmNinjaDeps AllDependencies; bool UsingGCCOnWindows; /// The set of custom commands we have seen. std::set<cmCustomCommand const*> CustomCommands; /// The set of custom command outputs we have seen. std::set<std::string> CustomCommandOutputs; /// Whether we are collecting known build outputs and needed /// dependencies to determine unknown dependencies. bool ComputingUnknownDependencies; cmPolicies::PolicyStatus PolicyCMP0058; /// The combined explicit dependencies of custom build commands std::set<std::string> CombinedCustomCommandExplicitDependencies; /// When combined with CombinedCustomCommandExplicitDependencies it allows /// us to detect the set of explicit dependencies that have std::set<std::string> CombinedBuildOutputs; /// The mapping from source file to assumed dependencies. std::map<std::string, std::set<std::string> > AssumedSourceDependencies; typedef std::map<std::string, cmGeneratorTarget*> TargetAliasMap; TargetAliasMap TargetAliases; typedef std::map<cmGeneratorTarget const*, std::set<cmGeneratorTarget const*> > TargetDependsClosureMap; TargetDependsClosureMap TargetDependsClosures; std::string NinjaCommand; std::string NinjaVersion; bool NinjaSupportsConsolePool; bool NinjaSupportsImplicitOuts; unsigned long NinjaSupportsDyndeps; private: void InitOutputPathPrefix(); std::string OutputPathPrefix; std::string TargetAll; std::string CMakeCacheFile; }; #endif // ! cmGlobalNinjaGenerator_h