Skip to content

Commit a7d2485

Browse files
committed
Style changes to PR pyscripter#59
1 parent b1acc06 commit a7d2485

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

PythonForDelphi/Components/Sources/Core/PythonEngine.pas

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,14 +2246,14 @@ TPythonEngine = class(TPythonInterface)
22462246
procedure Finalize;
22472247
procedure Lock;
22482248
procedure Unlock;
2249-
procedure SetPythonHome(PythonHome: String);
2249+
procedure SetPythonHome(const PythonHome: string);
22502250
function IsType(ob: PPyObject; obt: PPyTypeObject): Boolean;
22512251
function GetAttrString(obj: PPyObject; AName: PAnsiChar):PAnsiChar;
22522252
function CleanString(const s : AnsiString) : AnsiString;
22532253
function Run_CommandAsString(const command : AnsiString; mode : Integer) : String;
22542254
function Run_CommandAsObject(const command : AnsiString; mode : Integer) : PPyObject;
22552255
function Run_CommandAsObjectWithDict(const command : AnsiString; mode : Integer; locals, globals : PPyObject) : PPyObject;
2256-
function ToPythonRawString (str: String): AnsiString;
2256+
function StringToPythonBytes (const str: string): AnsiString;
22572257
procedure ExecString(const command : AnsiString); overload;
22582258
procedure ExecStrings( strings : TStrings ); overload;
22592259
function EvalString(const command : AnsiString) : PPyObject; overload;
@@ -5133,10 +5133,10 @@ procedure TPythonEngine.SetPyFlags(const Value: TPythonFlags);
51335133
end; // of if
51345134
end;
51355135

5136-
procedure TPythonEngine.SetPythonHome(PythonHome: String);
5136+
procedure TPythonEngine.SetPythonHome(const PythonHome: string);
51375137
begin
51385138
FPythonHomeW := PythonHome;
5139-
FPythonHome := ToPythonRawString(PythonHome);
5139+
FPythonHome := StringToPythonBytes(PythonHome);
51405140
end;
51415141

51425142
function TPythonEngine.IsType(ob: PPyObject; obt: PPyTypeObject): Boolean;
@@ -5308,12 +5308,12 @@ function TPythonEngine.Run_CommandAsObjectWithDict(const command : AnsiString; m
53085308

53095309
procedure TPythonEngine.ExecStrings( strings : TStrings );
53105310
begin
5311-
Py_XDecRef( Run_CommandAsObject( CleanString( ToPythonRawString(strings.Text) ), file_input ) );
5311+
Py_XDecRef( Run_CommandAsObject( CleanString( StringToPythonBytes(strings.Text) ), file_input ) );
53125312
end;
53135313

53145314
function TPythonEngine.EvalStrings( strings : TStrings ) : PPyObject;
53155315
begin
5316-
Result := Run_CommandAsObject( CleanString( ToPythonRawString(strings.Text) ), eval_input );
5316+
Result := Run_CommandAsObject( CleanString( StringToPythonBytes(strings.Text) ), eval_input );
53175317
end;
53185318

53195319
procedure TPythonEngine.ExecString(const command : AnsiString; locals, globals : PPyObject );
@@ -5323,7 +5323,7 @@ procedure TPythonEngine.ExecString(const command : AnsiString; locals, globals :
53235323

53245324
procedure TPythonEngine.ExecStrings( strings : TStrings; locals, globals : PPyObject );
53255325
begin
5326-
Py_XDecRef( Run_CommandAsObjectWithDict( CleanString( ToPythonRawString(strings.Text) ), file_input, locals, globals ) );
5326+
Py_XDecRef( Run_CommandAsObjectWithDict( CleanString( StringToPythonBytes(strings.Text) ), file_input, locals, globals ) );
53275327
end;
53285328

53295329
function TPythonEngine.EvalString( const command : AnsiString; locals, globals : PPyObject ) : PPyObject;
@@ -5333,12 +5333,12 @@ function TPythonEngine.EvalString( const command : AnsiString; locals, globals :
53335333

53345334
function TPythonEngine.EvalStrings( strings : TStrings; locals, globals : PPyObject ) : PPyObject;
53355335
begin
5336-
Result := Run_CommandAsObjectWithDict( CleanString( ToPythonRawString(strings.Text) ), eval_input, locals, globals );
5336+
Result := Run_CommandAsObjectWithDict( CleanString( StringToPythonBytes(strings.Text) ), eval_input, locals, globals );
53375337
end;
53385338

53395339
function TPythonEngine.EvalStringsAsStr( strings : TStrings ) : String;
53405340
begin
5341-
Result := Run_CommandAsString( CleanString( ToPythonRawString(strings.Text) ), eval_input );
5341+
Result := Run_CommandAsString( CleanString( StringToPythonBytes(strings.Text) ), eval_input );
53425342
end;
53435343

53445344
function TPythonEngine.CheckEvalSyntax( const str : AnsiString ) : Boolean;
@@ -5686,7 +5686,7 @@ function TPythonEngine.FindClient( const aName : string ) : TEngineClient;
56865686
end;
56875687
end;
56885688

5689-
function TPythonEngine.ToPythonRawString(str: String): AnsiString;
5689+
function TPythonEngine.StringToPythonBytes(const str: string): AnsiString;
56905690
begin
56915691
if IsPython3000 then
56925692
Result := UTF8Encode(str)

0 commit comments

Comments
 (0)