| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,3 @@ | |||
| 1 | - using System; | ||
| 2 | - using System.Collections; | ||
| 3 | - | ||
| 4 | 1 | namespace Python.Test | |
| 5 | 2 | { | |
| 6 | 3 | //======================================================================== | |
@@ -318,4 +315,4 @@ public static Spam[][] EchoRangeAA(Spam[][] items) | |||
| 318 | 315 | return items; | |
| 319 | 316 | } | |
| 320 | 317 | } | |
| 321 | - } | ||
| 318 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,4 @@ | |||
| 1 | - using System; | ||
| 2 | - using System.Collections.Generic; | ||
| 3 | - using System.Linq; | ||
| 4 | - using System.Text; | ||
| 1 | + using Python.Runtime; | ||
| 5 | 2 | ||
| 6 | 3 | namespace Python.Test | |
| 7 | 4 | { | |
@@ -13,32 +10,33 @@ public class CallbackTest | |||
| 13 | 10 | { | |
| 14 | 11 | public string Call_simpleDefaultArg_WithNull(string moduleName) | |
| 15 | 12 | { | |
| 16 | - using (Runtime.Py.GIL()) | ||
| 13 | + using (Py.GIL()) | ||
| 17 | 14 | { | |
| 18 | - dynamic module = Runtime.Py.Import(moduleName); | ||
| 15 | + dynamic module = Py.Import(moduleName); | ||
| 19 | 16 | return module.simpleDefaultArg(null); | |
| 20 | 17 | } | |
| 21 | 18 | } | |
| 19 | + | ||
| 22 | 20 | public string Call_simpleDefaultArg_WithEmptyArgs(string moduleName) | |
| 23 | 21 | { | |
| 24 | - using (Runtime.Py.GIL()) | ||
| 22 | + using (Py.GIL()) | ||
| 25 | 23 | { | |
| 26 | - dynamic module = Runtime.Py.Import(moduleName); | ||
| 24 | + dynamic module = Py.Import(moduleName); | ||
| 27 | 25 | return module.simpleDefaultArg(); | |
| 28 | 26 | } | |
| 29 | 27 | } | |
| 30 | 28 | } | |
| 31 | 29 | ||
| 32 | 30 | //========================================================================== | |
| 33 | 31 | // Tests calling from Python into C# and back into Python using a PyObject. | |
| 34 | - // SelfCallbackTest should be inherited by a Python class. | ||
| 32 | + // SelfCallbackTest should be inherited by a Python class. | ||
| 35 | 33 | // Used in test_class.py / testCallback | |
| 36 | 34 | //========================================================================== | |
| 37 | 35 | public class SelfCallbackTest | |
| 38 | 36 | { | |
| 39 | - public void Callback(Runtime.PyObject self) | ||
| 37 | + public void Callback(PyObject self) | ||
| 40 | 38 | { | |
| 41 | - using (Runtime.Py.GIL()) | ||
| 39 | + using (Py.GIL()) | ||
| 42 | 40 | ((dynamic)self).PyCallback(self); | |
| 43 | 41 | } | |
| 44 | 42 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,3 @@ | |||
| 1 | - using System; | ||
| 2 | 1 | using System.Collections; | |
| 3 | 2 | ||
| 4 | 3 | namespace Python.Test | |
@@ -61,4 +60,4 @@ public ClassCtorTest2(string v) | |||
| 61 | 60 | internal class InternalClass | |
| 62 | 61 | { | |
| 63 | 62 | } | |
| 64 | - } | ||
| 63 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,4 @@ | |||
| 1 | 1 | using System; | |
| 2 | - using System.Collections; | ||
| 3 | 2 | using System.IO; | |
| 4 | 3 | ||
| 5 | 4 | namespace Python.Test | |
@@ -50,4 +49,4 @@ public SubclassConstructorTest(Exception v) | |||
| 50 | 49 | this.value = v; | |
| 51 | 50 | } | |
| 52 | 51 | } | |
| 53 | - } | ||
| 52 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,3 @@ | |||
| 1 | - using System; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | 1 | namespace Python.Test | |
| 5 | 2 | { | |
| 6 | 3 | //======================================================================== | |
@@ -58,4 +55,4 @@ public string GetValue() | |||
| 58 | 55 | return value; | |
| 59 | 56 | } | |
| 60 | 57 | } | |
| 61 | - } | ||
| 58 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,3 @@ | |||
| 1 | - using System; | ||
| 2 | - | ||
| 3 | 1 | namespace Python.Test | |
| 4 | 2 | { | |
| 5 | 3 | //======================================================================== | |
@@ -60,4 +58,4 @@ public bool CallBoolDelegate(BoolDelegate d) | |||
| 60 | 58 | return d(); | |
| 61 | 59 | } | |
| 62 | 60 | } | |
| 63 | - } | ||
| 61 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,19 +8,19 @@ namespace Python.Test | |||
| 8 | 8 | ||
| 9 | 9 | // Classes with a constructor have their docstring set to the ctor signature. | |
| 10 | 10 | // Test if a class has an explicit doc string it gets set correctly. | |
| 11 | - [DocStringAttribute("DocWithCtorTest Class")] | ||
| 11 | + [DocString("DocWithCtorTest Class")] | ||
| 12 | 12 | public class DocWithCtorTest | |
| 13 | 13 | { | |
| 14 | 14 | public DocWithCtorTest() | |
| 15 | 15 | { | |
| 16 | 16 | } | |
| 17 | 17 | ||
| 18 | - [DocStringAttribute("DocWithCtorTest TestMethod")] | ||
| 18 | + [DocString("DocWithCtorTest TestMethod")] | ||
| 19 | 19 | public void TestMethod() | |
| 20 | 20 | { | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | - [DocStringAttribute("DocWithCtorTest StaticTestMethod")] | ||
| 23 | + [DocString("DocWithCtorTest StaticTestMethod")] | ||
| 24 | 24 | public static void StaticTestMethod() | |
| 25 | 25 | { | |
| 26 | 26 | } | |
@@ -41,17 +41,17 @@ public static void StaticTestMethod(double a, int b) | |||
| 41 | 41 | } | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | - [DocStringAttribute("DocWithoutCtorTest Class")] | ||
| 44 | + [DocString("DocWithoutCtorTest Class")] | ||
| 45 | 45 | public class DocWithoutCtorTest | |
| 46 | 46 | { | |
| 47 | - [DocStringAttribute("DocWithoutCtorTest TestMethod")] | ||
| 47 | + [DocString("DocWithoutCtorTest TestMethod")] | ||
| 48 | 48 | public void TestMethod() | |
| 49 | 49 | { | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | - [DocStringAttribute("DocWithoutCtorTest StaticTestMethod")] | ||
| 52 | + [DocString("DocWithoutCtorTest StaticTestMethod")] | ||
| 53 | 53 | public static void StaticTestMethod() | |
| 54 | 54 | { | |
| 55 | 55 | } | |
| 56 | 56 | } | |
| 57 | - } | ||
| 57 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,7 +86,7 @@ public enum ULongEnum : ulong | |||
| 86 | 86 | Five | |
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | - [FlagsAttribute] | ||
| 89 | + [Flags] | ||
| 90 | 90 | public enum FlagsEnum | |
| 91 | 91 | { | |
| 92 | 92 | Zero, | |
@@ -96,4 +96,4 @@ public enum FlagsEnum | |||
| 96 | 96 | Four, | |
| 97 | 97 | Five | |
| 98 | 98 | } | |
| 99 | - } | ||
| 99 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,4 +99,4 @@ public string GetExtraInfo() | |||
| 99 | 99 | return extra; | |
| 100 | 100 | } | |
| 101 | 101 | } | |
| 102 | - } | ||
| 102 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,3 @@ | |||
| 1 | - using System; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | 1 | namespace Python.Test | |
| 5 | 2 | { | |
| 6 | 3 | //======================================================================== | |
@@ -54,4 +51,4 @@ public void Shutup() | |||
| 54 | 51 | public object ObjectField; | |
| 55 | 52 | public ISpam SpamField; | |
| 56 | 53 | } | |
| 57 | - } | ||
| 54 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments