2011-12-20 09:32:09 +00:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
-- G N A T C O L L --
|
|
|
|
|
-- --
|
|
|
|
|
-- Copyright (C) 2003-2012, AdaCore --
|
|
|
|
|
-- --
|
|
|
|
|
-- This library is free software; you can redistribute it and/or modify it --
|
|
|
|
|
-- under terms of the GNU General Public License as published by the Free --
|
|
|
|
|
-- Software Foundation; either version 3, or (at your option) any later --
|
|
|
|
|
-- version. This library is distributed in the hope that it will be useful, --
|
|
|
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
|
|
|
|
|
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
|
|
|
|
|
-- --
|
|
|
|
|
-- As a special exception under Section 7 of GPL version 3, you are granted --
|
|
|
|
|
-- additional permissions described in the GCC Runtime Library Exception, --
|
|
|
|
|
-- version 3.1, as published by the Free Software Foundation. --
|
|
|
|
|
-- --
|
|
|
|
|
-- You should have received a copy of the GNU General Public License and --
|
|
|
|
|
-- a copy of the GCC Runtime Library Exception along with this program; --
|
|
|
|
|
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
|
|
|
|
|
-- <http://www.gnu.org/licenses/>. --
|
|
|
|
|
-- --
|
|
|
|
|
------------------------------------------------------------------------------
|
2007-06-11 07:57:59 +00:00
|
|
|
|
2011-08-29 14:56:41 +00:00
|
|
|
pragma Ada_05;
|
|
|
|
|
|
2007-06-11 07:57:59 +00:00
|
|
|
with Ada.Strings.Unbounded;
|
2008-04-17 12:12:00 +00:00
|
|
|
with GNATCOLL.Python; use GNATCOLL.Python;
|
2007-06-11 07:57:59 +00:00
|
|
|
|
2008-04-17 12:12:00 +00:00
|
|
|
package GNATCOLL.Scripts.Python is
|
2007-06-11 07:57:59 +00:00
|
|
|
|
|
|
|
|
Python_Name : constant String := "python";
|
|
|
|
|
|
|
|
|
|
procedure Register_Python_Scripting
|
2010-12-23 10:44:27 +00:00
|
|
|
(Repo : access Scripts.Scripts_Repository_Record'Class;
|
|
|
|
|
Module : String;
|
|
|
|
|
Program_Name : String := "python";
|
|
|
|
|
Python_Home : String := "");
|
2007-06-11 07:57:59 +00:00
|
|
|
-- All commands and classes will be added in the specified module.
|
2010-10-20 14:58:09 +00:00
|
|
|
--
|
|
|
|
|
-- Program_Name should be the name of the program registering Python
|
|
|
|
|
-- scripting. The interpreter will resove run-time libraries relative to
|
|
|
|
|
-- this executable.
|
|
|
|
|
--
|
|
|
|
|
-- If Python_Home is non-empty, it will be used as home, and libraries will
|
|
|
|
|
-- be searched for in <Python_Home>/lib/python<version>
|
2007-06-11 07:57:59 +00:00
|
|
|
|
2007-06-12 20:03:42 +00:00
|
|
|
procedure Unregister_Python_Scripting
|
2010-11-12 11:54:55 +00:00
|
|
|
(Repo : access Scripts.Scripts_Repository_Record'Class);
|
2007-06-12 20:03:42 +00:00
|
|
|
-- Mark the python scripting language as no longer valid. This should be
|
|
|
|
|
-- called before your application exits, to prevent unwanted storage_error
|
|
|
|
|
-- in the finalization of the application (since some class_instances might
|
|
|
|
|
-- be automatically finalized after python itself was destroyed, otherwise)
|
2007-06-11 07:57:59 +00:00
|
|
|
|
|
|
|
|
type Python_Scripting_Record is new Scripting_Language_Record with private;
|
|
|
|
|
type Python_Scripting is access all Python_Scripting_Record'Class;
|
2007-10-12 08:49:14 +00:00
|
|
|
pragma No_Strict_Aliasing (Python_Scripting);
|
2007-06-11 07:57:59 +00:00
|
|
|
|
|
|
|
|
type Python_Callback_Data is new Callback_Data with private;
|
|
|
|
|
|
2007-09-04 14:01:06 +00:00
|
|
|
function Get_Param
|
|
|
|
|
(Data : Python_Callback_Data'Class; N : Positive)
|
2007-06-11 07:57:59 +00:00
|
|
|
return PyObject;
|
2007-09-04 14:01:06 +00:00
|
|
|
procedure Get_Param
|
|
|
|
|
(Data : Python_Callback_Data'Class;
|
|
|
|
|
N : Positive;
|
|
|
|
|
Result : out PyObject;
|
|
|
|
|
Success : out Boolean);
|
2007-06-11 07:57:59 +00:00
|
|
|
-- Return the N-th command line parameter, taking into account the keywords
|
|
|
|
|
-- if any.
|
|
|
|
|
-- The returned value is a borrowed reference and must not be DECREF'd
|
|
|
|
|
|
2012-01-17 12:07:00 +00:00
|
|
|
procedure Set_Nth_Arg
|
|
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
N : Positive; Value : PyObject);
|
|
|
|
|
-- Sets the N-th command line parameter using a low-level PyObject.
|
|
|
|
|
|
|
|
|
|
procedure Set_Return_Value
|
|
|
|
|
(Data : in out Python_Callback_Data; Value : PyObject);
|
2012-03-16 10:38:51 +00:00
|
|
|
-- Sets the return value using a low-level PyObject.
|
|
|
|
|
-- The refcounting of Value is increased.
|
2012-01-17 12:07:00 +00:00
|
|
|
|
|
|
|
|
function Run_Command
|
|
|
|
|
(Script : access Python_Scripting_Record'Class;
|
|
|
|
|
Command : String;
|
|
|
|
|
Console : Virtual_Console := null;
|
|
|
|
|
Show_Command : Boolean := False;
|
|
|
|
|
Hide_Output : Boolean := False;
|
|
|
|
|
Hide_Exceptions : Boolean := False;
|
|
|
|
|
Errors : access Boolean) return PyObject;
|
|
|
|
|
-- Execute a command in the interpreter, and send its output to the
|
|
|
|
|
-- console. Return its return value (which doesn't need to be Py_DECREF,
|
|
|
|
|
-- since it is a borrowed reference).
|
|
|
|
|
-- If Hide_Output is True, then nothing is printed on the console. If the
|
|
|
|
|
-- command is incomplete and would require extra input (a secondary prompt
|
|
|
|
|
-- in interactive mode), then it is not executed.
|
|
|
|
|
-- Errors is set to True if there was an error executing the command or
|
|
|
|
|
-- if the input was incomplete.
|
|
|
|
|
|
|
|
|
|
function Get_PyObject (Instance : Class_Instance) return PyObject;
|
|
|
|
|
-- Returns the low level PyObject enclosed in a Python Class_Instance.
|
|
|
|
|
-- You need to be absolutely sure that Instance is a Python Instance.
|
|
|
|
|
|
2007-06-11 07:57:59 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
|
|
----------------------
|
|
|
|
|
-- Python_scripting --
|
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
|
|
type Python_Scripting_Record is new Scripting_Language_Record with record
|
2010-12-23 10:44:27 +00:00
|
|
|
Repo : Scripts_Repository;
|
|
|
|
|
Finalized : Boolean := False;
|
|
|
|
|
Blocked : Boolean := False;
|
|
|
|
|
Module : PyObject;
|
|
|
|
|
Builtin : PyObject;
|
|
|
|
|
Exception_Misc : PyObject;
|
|
|
|
|
Exception_Missing_Args : PyObject;
|
|
|
|
|
Exception_Invalid_Arg : PyObject;
|
|
|
|
|
Exception_Unexpected : PyObject;
|
2007-06-11 07:57:59 +00:00
|
|
|
|
2010-12-23 10:44:27 +00:00
|
|
|
Globals : PyObject;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- The global symbols for the python interpreter
|
|
|
|
|
|
2010-12-23 10:44:27 +00:00
|
|
|
Use_Secondary_Prompt : Boolean := False;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- Which type of prompt should be displayed
|
|
|
|
|
|
2010-12-23 10:44:27 +00:00
|
|
|
Buffer : GNAT.Strings.String_Access;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- Buffer for the command, to be added in front of any command before
|
2010-12-23 10:44:27 +00:00
|
|
|
-- executing. This is used for multi-line input.
|
2007-06-11 07:57:59 +00:00
|
|
|
|
2010-12-23 10:44:27 +00:00
|
|
|
Ignore_Constructor : Boolean := False;
|
2010-11-15 14:56:33 +00:00
|
|
|
-- Whether we are creating a new instance of a class.
|
|
|
|
|
-- This is used to disable the call to __init__ (for backward
|
|
|
|
|
-- compatibility and because we wouldn't know how to pass extra
|
|
|
|
|
-- arguments to New_Instance).
|
|
|
|
|
|
2010-12-23 10:44:27 +00:00
|
|
|
In_Process : Boolean := False;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- True while we are processing a command. This is used to control the
|
2010-12-23 10:44:27 +00:00
|
|
|
-- behavior of control-c: either interrupt, or copy.
|
2007-06-11 07:57:59 +00:00
|
|
|
|
2010-12-23 10:44:27 +00:00
|
|
|
Current_File : Ada.Strings.Unbounded.Unbounded_String;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- The script we are currently executing
|
|
|
|
|
end record;
|
|
|
|
|
|
* aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.
* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.
* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.
* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.
* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.
* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.
* expect_interface.adb:
(Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.
* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.
* gnatcoll-command_lines.adb:
Initial revision.
* gnatcoll-command_lines.ads:
Initial revision.
* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.
* gnatcoll-scripts-utils.ads:
Add ??? comment.
* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.
* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.
* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.
* debugger.ads:
Add ??? comment.
* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.
* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.
* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.
* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.
* gps-kernel-macros.adb:
(Substitute): No need to protect paths.
* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.
* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
command line.
* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.
* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.
* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.
* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.
* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.
* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* gnatpp.xml:
Remove unneeded triple quoting.
* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
Add ??? comment.
* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.
* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.
* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.
* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.
* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.
* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.
Change the way GPS handles command lines. Introduce a new type
(GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
manipulate command lines.
For H926-007.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
|
|
|
overriding function Command_Line_Treatment
|
|
|
|
|
(Script : access Python_Scripting_Record) return Command_Line_Mode;
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Destroy (Script : access Python_Scripting_Record);
|
|
|
|
|
overriding procedure Block_Commands
|
|
|
|
|
(Script : access Python_Scripting_Record; Block : Boolean);
|
|
|
|
|
overriding procedure Register_Command
|
2010-11-17 12:06:29 +00:00
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Cmd : Command_Descr_Access);
|
2010-11-18 11:20:51 +00:00
|
|
|
overriding procedure Register_Property
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Prop : Property_Descr_Access);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Register_Class
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Name : String;
|
|
|
|
|
Base : Class_Type := No_Class);
|
|
|
|
|
overriding function Create
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Arguments_Count : Natural) return Callback_Data'Class;
|
|
|
|
|
overriding function New_Instance
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
2010-12-23 10:44:27 +00:00
|
|
|
Class : Class_Type) return Class_Instance;
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
2009-11-23 17:31:43 +00:00
|
|
|
CL : Arg_List;
|
2007-06-11 07:57:59 +00:00
|
|
|
Console : Virtual_Console := null;
|
|
|
|
|
Hide_Output : Boolean := False;
|
|
|
|
|
Show_Command : Boolean := True;
|
|
|
|
|
Errors : out Boolean);
|
|
|
|
|
overriding function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
2009-11-23 17:31:43 +00:00
|
|
|
CL : Arg_List;
|
2007-06-11 07:57:59 +00:00
|
|
|
Console : Virtual_Console := null;
|
|
|
|
|
Hide_Output : Boolean := False;
|
|
|
|
|
Show_Command : Boolean := True;
|
|
|
|
|
Errors : access Boolean) return String;
|
|
|
|
|
overriding function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
2009-11-23 17:31:43 +00:00
|
|
|
CL : Arg_List;
|
2007-06-11 07:57:59 +00:00
|
|
|
Console : Virtual_Console := null;
|
|
|
|
|
Hide_Output : Boolean := False;
|
|
|
|
|
Errors : access Boolean) return Boolean;
|
|
|
|
|
overriding function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Command : String;
|
|
|
|
|
Args : Callback_Data'Class) return Boolean;
|
|
|
|
|
function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record'Class;
|
|
|
|
|
Command : PyObject;
|
2011-02-02 08:09:03 +00:00
|
|
|
Args : Callback_Data'Class;
|
|
|
|
|
Error : access Boolean) return String;
|
* build_command_manager.adb:
(Execute): The hook for Compute_Build_Targets_Hook now returns an Any_Type.
* builder_facility_module.adb:
(On_Compute_Build_Targets): This now returns an Any_Type. The structure of this
Any_Type is described in shell_commands.xml.
(Install_Button_For_Target): The hook for Compute_Build_Targets_Hook now
returns an Any_Type, adapt.
(Add_Menu_For_Target): Likewise.
* gnatcoll-any_types.adb:
Initial revision.
* gnatcoll-any_types.ads:
Initial revision.
* gnatcoll-scripts-shell.adb:
Implement overriding subprogram Execute [Any_Type].
* gnatcoll-scripts-shell.ads:
Declare overriding subprogram Execute [Any_Type].
* gnatcoll-scripts.ads:
(Execute): New abstract subprogram, returning an Any_Type.
* gnatcoll-any_types-python.adb:
Initial revision.
* gnatcoll-any_types-python.ads:
Initial revision.
* gnatcoll-scripts-python.adb:
(Execute): Declare overriding subprogram. Implement.
(Execute_Command): New subprogram.
* gnatcoll-scripts-python.ads:
(Execute_Command): New subprogram.
* gps-kernel-hooks.adb:
(Command_Handler_Return_Any): New subprogram.
(Wrapper_Return_Any): New type.
(Execute): Implement wrappers.
(Destroy): Implement.
(Run_Hook_Until_Not_Empty): New subprogram.
(Register_Standard_Hooks): The hook Compute_Build_Targets_Hook now returns an
Any_Type.
* gps-kernel-hooks.ads:
Add functions allowing to launch hooks that return Any_Types.
Add documentation.
* Makefile.py:
Adapt to new return types of compute_build_targets hook.
* shell_commands.xml:
Document new return type of compute_build_targets hook.
Follow-up on I302-024.
We want to display the base names of "main" targets in the Build menu, and we
also want the hook to contain the full path to the main file in order to
support "%TT".
We cannot do a simple "base_name" on the target when it comes to adding it to
the menu, because this suppresses useful information coming from targets from
Makefile.py.
To solve this, the hook "compute_build_targets" now returns a list of targets,
with, for each target, the name to display in the menu, and the full name.
In order to implement this, we introduce a way for hooks to return complex
information, mapping a subset of the Python types.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@143141 936e1b1b-40f2-da11-902a-00137254ae57
2009-04-22 13:16:40 +00:00
|
|
|
function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record'Class;
|
|
|
|
|
Command : PyObject;
|
2011-02-02 08:09:03 +00:00
|
|
|
Args : Callback_Data'Class;
|
|
|
|
|
Error : access Boolean) return Any_Type;
|
2007-06-11 07:57:59 +00:00
|
|
|
function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record'Class;
|
|
|
|
|
Command : PyObject;
|
2011-02-02 08:09:03 +00:00
|
|
|
Args : Callback_Data'Class;
|
|
|
|
|
Error : access Boolean) return PyObject;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- Need to unref the returned value
|
|
|
|
|
|
|
|
|
|
function Execute_Command
|
|
|
|
|
(Script : access Python_Scripting_Record'Class;
|
|
|
|
|
Command : PyObject;
|
2011-02-02 08:09:03 +00:00
|
|
|
Args : Callback_Data'Class;
|
|
|
|
|
Error : access Boolean) return Boolean;
|
2010-12-23 09:23:54 +00:00
|
|
|
overriding procedure Load_Directory
|
2010-12-23 10:44:27 +00:00
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Directory : GNATCOLL.VFS.Virtual_File;
|
|
|
|
|
To_Load : Script_Loader := Load_All'Access);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Execute_File
|
2010-12-23 10:44:27 +00:00
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Filename : String;
|
|
|
|
|
Console : Virtual_Console := null;
|
|
|
|
|
Hide_Output : Boolean := False;
|
2007-06-11 07:57:59 +00:00
|
|
|
Show_Command : Boolean := True;
|
2010-12-23 10:44:27 +00:00
|
|
|
Errors : out Boolean);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding function Get_Name
|
|
|
|
|
(Script : access Python_Scripting_Record) return String;
|
|
|
|
|
overriding function Get_Repository
|
|
|
|
|
(Script : access Python_Scripting_Record) return Scripts_Repository;
|
|
|
|
|
overriding function Current_Script
|
|
|
|
|
(Script : access Python_Scripting_Record) return String;
|
|
|
|
|
overriding procedure Set_Default_Console
|
2010-12-23 10:44:27 +00:00
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Console : Virtual_Console);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Display_Prompt
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Console : Virtual_Console := null);
|
|
|
|
|
overriding function Interrupt
|
|
|
|
|
(Script : access Python_Scripting_Record) return Boolean;
|
|
|
|
|
overriding procedure Complete
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
|
|
|
|
Input : String;
|
|
|
|
|
Completions : out String_Lists.List);
|
2010-11-16 13:13:47 +00:00
|
|
|
overriding function New_List
|
|
|
|
|
(Script : access Python_Scripting_Record;
|
2010-12-23 10:44:27 +00:00
|
|
|
Class : Class_Type := No_Class) return List_Instance'Class;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- See doc from inherited subprograms
|
|
|
|
|
|
|
|
|
|
type Python_Callback_Data is new Callback_Data with record
|
|
|
|
|
Script : Python_Scripting;
|
2010-11-15 17:33:14 +00:00
|
|
|
|
2007-06-11 07:57:59 +00:00
|
|
|
Args, Kw : PyObject;
|
2010-11-17 10:00:16 +00:00
|
|
|
-- Args is a tuple, a list, or any iterable.
|
|
|
|
|
-- These are the arguments passed by python. If Name_Parameters was
|
|
|
|
|
-- called, these are modified in place: Kw is reset to null, and its
|
|
|
|
|
-- contents merged into Args. Args is resized appropriately (to the
|
|
|
|
|
-- number of arguments passed to Name_Parameters). This cannot be used
|
|
|
|
|
-- for functions with a variable number of parameters.
|
2010-11-15 17:33:14 +00:00
|
|
|
|
2010-11-17 10:00:16 +00:00
|
|
|
Return_Value : PyObject;
|
|
|
|
|
Return_Dict : PyObject;
|
|
|
|
|
Has_Return_Value : Boolean := False;
|
|
|
|
|
Return_As_List : Boolean := False;
|
|
|
|
|
|
|
|
|
|
First_Arg_Is_Self : Boolean;
|
|
|
|
|
-- True if the first argument is "self", ie we are calling a method
|
2007-06-11 07:57:59 +00:00
|
|
|
end record;
|
|
|
|
|
|
|
|
|
|
overriding function Clone
|
|
|
|
|
(Data : Python_Callback_Data) return Callback_Data'Class;
|
|
|
|
|
overriding function Get_Script
|
|
|
|
|
(Data : Python_Callback_Data) return Scripting_Language;
|
|
|
|
|
overriding function Number_Of_Arguments
|
|
|
|
|
(Data : Python_Callback_Data) return Natural;
|
|
|
|
|
overriding procedure Name_Parameters
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data; Names : Cst_Argument_List);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive) return String;
|
2010-12-11 10:30:40 +00:00
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive) return Unbounded_String;
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive) return Integer;
|
|
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive) return Boolean;
|
|
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive) return Subprogram_Type;
|
|
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive; Class : Class_Type;
|
|
|
|
|
Allow_Null : Boolean := False)
|
|
|
|
|
return Class_Instance;
|
2007-09-04 14:01:06 +00:00
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive; Default : String)
|
|
|
|
|
return String;
|
|
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive; Default : Integer)
|
|
|
|
|
return Integer;
|
|
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data; N : Positive; Default : Boolean)
|
|
|
|
|
return Boolean;
|
|
|
|
|
overriding function Nth_Arg
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : Python_Callback_Data;
|
|
|
|
|
N : Positive;
|
|
|
|
|
Class : Class_Type := Any_Class;
|
|
|
|
|
Default : Class_Instance;
|
2007-09-04 14:01:06 +00:00
|
|
|
Allow_Null : Boolean := False) return Class_Instance;
|
|
|
|
|
overriding function Nth_Arg
|
|
|
|
|
(Data : Python_Callback_Data;
|
|
|
|
|
N : Positive;
|
|
|
|
|
Default : Subprogram_Type) return Subprogram_Type;
|
2010-11-15 17:33:14 +00:00
|
|
|
overriding function Nth_Arg
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : Python_Callback_Data; N : Positive) return List_Instance'Class;
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Error_Msg
|
|
|
|
|
(Data : in out Python_Callback_Data; Msg : String);
|
|
|
|
|
overriding procedure Set_Return_Value_As_List
|
2010-11-15 15:51:10 +00:00
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
Size : Natural := 0;
|
|
|
|
|
Class : Class_Type := No_Class);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Return_Value
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data; Value : Integer);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Return_Value
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data; Value : String);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Return_Value
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data; Value : Boolean);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Return_Value
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data; Value : Class_Instance);
|
2010-11-16 13:13:47 +00:00
|
|
|
overriding procedure Set_Return_Value
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data; Value : List_Instance);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Return_Value_Key
|
|
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
Key : String;
|
|
|
|
|
Append : Boolean := False);
|
|
|
|
|
overriding procedure Set_Return_Value_Key
|
|
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
Key : Integer;
|
|
|
|
|
Append : Boolean := False);
|
|
|
|
|
overriding procedure Set_Return_Value_Key
|
|
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
Key : Class_Instance;
|
|
|
|
|
Append : Boolean := False);
|
|
|
|
|
overriding procedure Free (Data : in out Python_Callback_Data);
|
|
|
|
|
overriding procedure Set_Nth_Arg
|
* aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.
* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.
* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.
* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.
* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.
* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.
* expect_interface.adb:
(Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.
* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.
* gnatcoll-command_lines.adb:
Initial revision.
* gnatcoll-command_lines.ads:
Initial revision.
* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.
* gnatcoll-scripts-utils.ads:
Add ??? comment.
* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.
* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.
* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.
* debugger.ads:
Add ??? comment.
* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.
* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.
* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.
* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.
* gps-kernel-macros.adb:
(Substitute): No need to protect paths.
* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.
* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
command line.
* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.
* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.
* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.
* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.
* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.
* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* gnatpp.xml:
Remove unneeded triple quoting.
* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
Add ??? comment.
* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.
* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.
* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.
* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.
* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.
* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.
Change the way GPS handles command lines. Introduce a new type
(GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
manipulate command lines.
For H926-007.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
|
|
|
(Data : in out Python_Callback_Data; N : Positive; Value : String);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Nth_Arg
|
* aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.
* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.
* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.
* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.
* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.
* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.
* expect_interface.adb:
(Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.
* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.
* gnatcoll-command_lines.adb:
Initial revision.
* gnatcoll-command_lines.ads:
Initial revision.
* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.
* gnatcoll-scripts-utils.ads:
Add ??? comment.
* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.
* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.
* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.
* debugger.ads:
Add ??? comment.
* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.
* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.
* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.
* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.
* gps-kernel-macros.adb:
(Substitute): No need to protect paths.
* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.
* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
command line.
* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.
* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.
* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.
* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.
* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.
* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* gnatpp.xml:
Remove unneeded triple quoting.
* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
Add ??? comment.
* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.
* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.
* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.
* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.
* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.
* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.
Change the way GPS handles command lines. Introduce a new type
(GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
manipulate command lines.
For H926-007.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
|
|
|
(Data : in out Python_Callback_Data; N : Positive; Value : Integer);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Nth_Arg
|
* aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.
* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.
* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.
* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.
* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.
* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.
* expect_interface.adb:
(Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.
* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.
* gnatcoll-command_lines.adb:
Initial revision.
* gnatcoll-command_lines.ads:
Initial revision.
* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.
* gnatcoll-scripts-utils.ads:
Add ??? comment.
* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.
* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.
* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.
* debugger.ads:
Add ??? comment.
* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.
* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.
* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.
* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.
* gps-kernel-macros.adb:
(Substitute): No need to protect paths.
* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.
* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
command line.
* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.
* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.
* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.
* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.
* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.
* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* gnatpp.xml:
Remove unneeded triple quoting.
* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
Add ??? comment.
* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.
* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.
* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.
* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.
* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.
* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.
Change the way GPS handles command lines. Introduce a new type
(GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
manipulate command lines.
For H926-007.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
|
|
|
(Data : in out Python_Callback_Data; N : Positive; Value : Boolean);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Nth_Arg
|
* aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.
* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.
* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.
* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.
* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.
* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.
* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.
* expect_interface.adb:
(Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.
* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.
* gnatcoll-command_lines.adb:
Initial revision.
* gnatcoll-command_lines.ads:
Initial revision.
* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.
* gnatcoll-scripts-utils.ads:
Add ??? comment.
* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.
* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.
* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.
* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.
* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.
* debugger.ads:
Add ??? comment.
* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.
* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.
* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.
* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.
* gps-kernel-macros.adb:
(Substitute): No need to protect paths.
* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
represent command lines.
* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.
* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.
* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
command line.
* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.
* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.
* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.
* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.
* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.
* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* gnatpp.xml:
Remove unneeded triple quoting.
* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
to not be surrounded by quotes, so that they expand into multiple arguments.
* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
Add ??? comment.
* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.
* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.
* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.
* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.
* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.
* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.
* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.
* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.
* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.
Change the way GPS handles command lines. Introduce a new type
(GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
manipulate command lines.
For H926-007.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
N : Positive; Value : Class_Instance);
|
2010-11-16 13:13:47 +00:00
|
|
|
overriding procedure Set_Nth_Arg
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
N : Positive;
|
|
|
|
|
Value : List_Instance);
|
2007-06-11 07:57:59 +00:00
|
|
|
overriding procedure Set_Nth_Arg
|
2010-12-23 10:44:27 +00:00
|
|
|
(Data : in out Python_Callback_Data;
|
|
|
|
|
N : Positive;
|
|
|
|
|
Value : Subprogram_Type);
|
2011-03-21 16:14:36 +00:00
|
|
|
overriding procedure Execute_Command
|
|
|
|
|
(Args : in out Python_Callback_Data;
|
|
|
|
|
Command : String);
|
|
|
|
|
overriding function Return_Value
|
|
|
|
|
(Data : Python_Callback_Data) return String;
|
|
|
|
|
overriding function Return_Value
|
|
|
|
|
(Data : Python_Callback_Data) return Integer;
|
|
|
|
|
overriding function Return_Value
|
|
|
|
|
(Data : Python_Callback_Data) return Boolean;
|
|
|
|
|
overriding function Return_Value
|
|
|
|
|
(Data : Python_Callback_Data) return Class_Instance;
|
|
|
|
|
overriding function Return_Value
|
|
|
|
|
(Data : Python_Callback_Data) return List_Instance'Class;
|
2007-06-11 07:57:59 +00:00
|
|
|
-- See doc from inherited subprogram
|
|
|
|
|
|
2008-04-17 12:12:00 +00:00
|
|
|
end GNATCOLL.Scripts.Python;
|