diff options
author | Adam Frisby | 2008-05-08 04:34:02 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-08 04:34:02 +0000 |
commit | 80cbd468ea4dca31c0bf28607f4ab3ed3963f765 (patch) | |
tree | 2cc6dd32a1c954f8af16ac46f2a7a5138418fefa /OpenSim/Region/Modules | |
parent | * For no good reason (since there are a hundred million other things to fix),... (diff) | |
download | opensim-SC-80cbd468ea4dca31c0bf28607f4ab3ed3963f765.zip opensim-SC-80cbd468ea4dca31c0bf28607f4ab3ed3963f765.tar.gz opensim-SC-80cbd468ea4dca31c0bf28607f4ab3ed3963f765.tar.bz2 opensim-SC-80cbd468ea4dca31c0bf28607f4ab3ed3963f765.tar.xz |
* Some refactorings.
* Added shell of new Python scripting engine. Similar in design to the one used by Rex, but will be structured at a region rather than object level, also is a region module.
Diffstat (limited to 'OpenSim/Region/Modules')
-rw-r--r-- | OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs | 36 | ||||
-rw-r--r-- | OpenSim/Region/Modules/Python/PythonAPI/Console.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/Modules/Python/PythonModule.cs | 48 |
3 files changed, 105 insertions, 0 deletions
diff --git a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e4d7852 --- /dev/null +++ b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,36 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("Python")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("")] | ||
12 | [assembly: AssemblyProduct("Python")] | ||
13 | [assembly: AssemblyCopyright("Copyright © 2008")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("5bd55f67-385d-4a43-893a-b5d2ea43f07d")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | ||
33 | // by using the '*' as shown below: | ||
34 | // [assembly: AssemblyVersion("1.0.*")] | ||
35 | [assembly: AssemblyVersion("1.0.0.0")] | ||
36 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Region/Modules/Python/PythonAPI/Console.cs b/OpenSim/Region/Modules/Python/PythonAPI/Console.cs new file mode 100644 index 0000000..0d23dc6 --- /dev/null +++ b/OpenSim/Region/Modules/Python/PythonAPI/Console.cs | |||
@@ -0,0 +1,21 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using log4net; | ||
4 | |||
5 | namespace OpenSim.Region.Modules.Python.PythonAPI | ||
6 | { | ||
7 | class Console | ||
8 | { | ||
9 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
10 | |||
11 | public void WriteLine(string txt) | ||
12 | { | ||
13 | m_log.Info(txt); | ||
14 | } | ||
15 | |||
16 | public void WriteLine(string txt, params Object[] e) | ||
17 | { | ||
18 | m_log.Info(String.Format(txt, e)); | ||
19 | } | ||
20 | } | ||
21 | } | ||
diff --git a/OpenSim/Region/Modules/Python/PythonModule.cs b/OpenSim/Region/Modules/Python/PythonModule.cs new file mode 100644 index 0000000..142a7df --- /dev/null +++ b/OpenSim/Region/Modules/Python/PythonModule.cs | |||
@@ -0,0 +1,48 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Reflection; | ||
4 | using System.Security.Policy; | ||
5 | using System.Text; | ||
6 | using IronPython.Hosting; | ||
7 | using log4net; | ||
8 | using Nini.Config; | ||
9 | using OpenSim.Region.Environment.Interfaces; | ||
10 | using OpenSim.Region.Environment.Scenes; | ||
11 | |||
12 | namespace OpenSim.Region.Modules.Python | ||
13 | { | ||
14 | class PythonModule : IRegionModule | ||
15 | { | ||
16 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
17 | private PythonEngine m_python; | ||
18 | |||
19 | public void Initialise(Scene scene, IConfigSource source) | ||
20 | { | ||
21 | |||
22 | } | ||
23 | |||
24 | public void PostInitialise() | ||
25 | { | ||
26 | /* | ||
27 | m_log.Info("[PYTHON] Initialising IronPython engine."); | ||
28 | m_python = new PythonEngine(); | ||
29 | m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); | ||
30 | */ | ||
31 | } | ||
32 | |||
33 | public void Close() | ||
34 | { | ||
35 | |||
36 | } | ||
37 | |||
38 | public string Name | ||
39 | { | ||
40 | get { return "PythonModule"; } | ||
41 | } | ||
42 | |||
43 | public bool IsSharedModule | ||
44 | { | ||
45 | get { return true; } | ||
46 | } | ||
47 | } | ||
48 | } | ||