C# Class IronPython.Hosting.PythonCommandLine

A simple Python command-line should mimic the standard python.exe
Inheritance: CommandLine
ファイルを表示 Open project: jschementi/iron Class Usage Examples

Private Properties

Property Type Description
GetEffectiveExitCode int
GetVersionString string
ImportSite void
InitializeExtensionDLLs void
InitializeModules string
InitializePath void
RunCommandWorker int
RunFileWorker int
RunOneInteraction int?
RunStartup void
TryInteractiveActionWorker int?

Public Methods

Method Description
GetGlobals ( string name ) : IList
GetLogoDisplay ( ) : string

Returns the display look for IronPython. The returned string uses This \n instead of Environment.NewLine for it's line seperator because it is intended to be outputted through the Python I/O system.

PythonCommandLine ( ) : System

Protected Methods

Method Description
CreateScope ( ) : Scope
GetNextAutoIndentSize ( string text ) : int
Initialize ( ) : void
Run ( ) : int
RunCommand ( string command ) : int
RunFile ( string fileName ) : int
RunInteractive ( ) : int
Shutdown ( ) : void
TryInteractiveAction ( ) : int?
UnhandledException ( Exception e ) : void

Private Methods

Method Description
GetEffectiveExitCode ( SystemExitException e ) : int
GetVersionString ( ) : string
ImportSite ( ) : void
InitializeExtensionDLLs ( ) : void

Loads any extension DLLs present in sys.prefix\DLLs directory and adds references to them. This provides an easy drop-in location for .NET assemblies which should be automatically referenced (exposed via import), COM libraries, and pre-compiled Python code.

InitializeModules ( ) : string
InitializePath ( int &pathIndex ) : void
RunCommandWorker ( string command ) : int
RunFileWorker ( string fileName ) : int
RunOneInteraction ( ) : int?

Parses a single interactive command and executes it. Returns null if successful and execution should continue, or the appropiate exit code.

RunStartup ( ) : void
TryInteractiveActionWorker ( ) : int?

Attempts to run a single interaction and handle any language-specific exceptions. Base classes can override this and call the base implementation surrounded with their own exception handling. Returns null if successful and execution should continue, or an exit code.

Method Details

CreateScope() protected method

protected CreateScope ( ) : Scope
return Scope

GetGlobals() public method

public GetGlobals ( string name ) : IList
name string
return IList

GetLogoDisplay() public static method

Returns the display look for IronPython. The returned string uses This \n instead of Environment.NewLine for it's line seperator because it is intended to be outputted through the Python I/O system.
public static GetLogoDisplay ( ) : string
return string

GetNextAutoIndentSize() protected method

protected GetNextAutoIndentSize ( string text ) : int
text string
return int

Initialize() protected method

protected Initialize ( ) : void
return void

PythonCommandLine() public method

public PythonCommandLine ( ) : System
return System

Run() protected method

protected Run ( ) : int
return int

RunCommand() protected method

protected RunCommand ( string command ) : int
command string
return int

RunFile() protected method

protected RunFile ( string fileName ) : int
fileName string
return int

RunInteractive() protected method

protected RunInteractive ( ) : int
return int

Shutdown() protected method

protected Shutdown ( ) : void
return void

TryInteractiveAction() protected method

protected TryInteractiveAction ( ) : int?
return int?

UnhandledException() protected method

protected UnhandledException ( Exception e ) : void
e Exception
return void