Browse Source

Namespace imports now import all classes on conversion to IronPython.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4152 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
d8ca9a66b1
  1. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs
  2. 6
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/UsingStatementConversionTestFixture.cs

2
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs

@ -1185,7 +1185,7 @@ namespace ICSharpCode.PythonBinding @@ -1185,7 +1185,7 @@ namespace ICSharpCode.PythonBinding
{
// Add import statements for each using.
foreach (Using @using in usingDeclaration.Usings) {
AppendIndentedLine("import " + @using.Name);
AppendIndentedLine("from " + @using.Name + " import *");
}
return null;
}

6
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/UsingStatementConversionTestFixture.cs

@ -25,7 +25,7 @@ namespace PythonBinding.Tests.Converter @@ -25,7 +25,7 @@ namespace PythonBinding.Tests.Converter
{
NRefactoryToPythonConverter converter = new NRefactoryToPythonConverter(SupportedLanguage.CSharp);
string python = converter.Convert(csharp);
string expectedPython = "import System\r\n" +
string expectedPython = "from System import *\r\n" +
"class Foo(object):\r\n" +
"\tpass";
@ -43,8 +43,8 @@ namespace PythonBinding.Tests.Converter @@ -43,8 +43,8 @@ namespace PythonBinding.Tests.Converter
NRefactoryToPythonConverter converter = new NRefactoryToPythonConverter(SupportedLanguage.CSharp);
string python = converter.Convert(csharp);
string expectedPython = "import System\r\n" +
"import System.Drawing\r\n" +
string expectedPython = "from System import *\r\n" +
"from System.Drawing import *\r\n" +
"class Foo(object):\r\n" +
"\tpass";

Loading…
Cancel
Save