Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Commit ed78b3f

Browse files
committed
Code cleanup: Replaced \t with 8 spaces in all *.cs files
1 parent 728ccf9 commit ed78b3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+8451
-8444
lines changed

pythonnet/doc/mono_config.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# copy this file to ~/.mono/config or add the dllmaps to the global
22
# configuration file /etc/mono/config
33
<configuration>
4-
<dllmap dll="python23" target="libpython2.3.so" os="!windows" />
5-
<dllmap dll="python23.dll" target="libpython2.3.so" os="!windows" />
6-
<dllmap dll="python24" target="libpython2.4.so" os="!windows" />
7-
<dllmap dll="python24.dll" target="libpython2.4.so" os="!windows" />
8-
<dllmap dll="python25" target="libpython2.5.so" os="!windows" />
9-
<dllmap dll="python25.dll" target="libpython2.5.so" os="!windows" />
10-
<dllmap dll="python26" target="libpython2.6.so" os="!windows" />
11-
<dllmap dll="python26.dll" target="libpython2.6.so" os="!windows" />
4+
<dllmap dll="python23" target="libpython2.3.so" os="!windows" />
5+
<dllmap dll="python23.dll" target="libpython2.3.so" os="!windows" />
6+
<dllmap dll="python24" target="libpython2.4.so" os="!windows" />
7+
<dllmap dll="python24.dll" target="libpython2.4.so" os="!windows" />
8+
<dllmap dll="python25" target="libpython2.5.so" os="!windows" />
9+
<dllmap dll="python25.dll" target="libpython2.5.so" os="!windows" />
10+
<dllmap dll="python26" target="libpython2.6.so" os="!windows" />
11+
<dllmap dll="python26.dll" target="libpython2.6.so" os="!windows" />
1212
</configuration>
1313

pythonnet/setup.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,29 @@
1313
"""
1414

1515
from setuptools import setup
16-
from setuptools import find_packages
1716
from setuptools import Extension
17+
import subprocess
1818

19-
import commands
2019
def pkgconfig(*packages, **kw):
2120
"""From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502261
2221
"""
2322
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
24-
output = commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split()
25-
for token in output:
23+
cmd = "pkg-config --libs --cflags %s" % ' '.join(packages)
24+
popen = subprocess.Popen(cmd, shell=True, close_fds=True, stdout=subprocess.PIPE)
25+
popen.wait()
26+
if popen.returncode != 0:
27+
raise RuntimeError("An error has occured")
28+
output = popen.stdout.read().strip()
29+
30+
for token in output.split():
2631
if flag_map.has_key(token[:2]):
2732
kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
2833
else: # throw others to extra_link_args
2934
kw.setdefault('extra_link_args', []).append(token)
35+
3036
for k, v in kw.iteritems(): # remove duplicated
3137
kw[k] = list(set(v))
38+
3239
return kw
3340

3441
clr = Extension('clr',

pythonnet/src/console/assemblyinfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
[assembly:PermissionSetAttribute(SecurityAction.RequestMinimum,
25-
Name = "FullTrust")]
25+
Name = "FullTrust")]
2626
[assembly: AssemblyDescriptionAttribute("")]
2727
[assembly: AssemblyCopyrightAttribute("Zope Public License, Version 2.0 (ZPL)")]
2828
[assembly: AssemblyFileVersionAttribute("2.0.0.2")]

pythonnet/src/console/pythonconsole.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ private PythonConsole() {}
1818

1919
[STAThread]
2020
public static int Main(string[] args) {
21-
string [] cmd = Environment.GetCommandLineArgs();
22-
PythonEngine.Initialize();
21+
string [] cmd = Environment.GetCommandLineArgs();
22+
PythonEngine.Initialize();
2323

24-
int i = Runtime.Py_Main(cmd.Length, cmd);
25-
PythonEngine.Shutdown();
24+
int i = Runtime.Py_Main(cmd.Length, cmd);
25+
PythonEngine.Shutdown();
2626

2727
return i;
2828
}

pythonnet/src/monoclr/pynetinit.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PyNet_Args* PyNet_Init(int ext) {
4040
* mono_runtime_exec_managed_code(pn_args->domain, main_thread_handler,
4141
* pn_args);
4242
*/
43-
43+
4444
main_thread_handler(pn_args);
4545

4646
if (pn_args->error != NULL) {
@@ -59,9 +59,9 @@ void PyNet_Finalize(PyNet_Args *pn_args) {
5959
if (exception) {
6060
pn_args->error = "An exception was raised during shutdown";
6161
fprintf(stderr, pn_args->error);
62-
fprintf(stderr, "\n");
62+
fprintf(stderr, "\n");
6363
}
64-
pn_args->shutdown = NULL;
64+
pn_args->shutdown = NULL;
6565
}
6666

6767
if (pn_args->domain) {
@@ -98,30 +98,30 @@ void main_thread_handler (gpointer user_data) {
9898
pr_image = mono_assembly_get_image(pn_args->pr_assm);
9999
if (!pr_image) {
100100
pn_args->error = "Unable to get image";
101-
return;
101+
return;
102102
}
103103

104104
pythonengine = mono_class_from_name(pr_image, "Python.Runtime", "PythonEngine");
105105
if (!pythonengine) {
106106
pn_args->error = "Unable to load class PythonEngine from Python.Runtime";
107-
return;
107+
return;
108108
}
109109

110110
init = getMethodFromClass(pythonengine, pn_args->init_name);
111111
if (!init) {
112112
pn_args->error = "Unable to fetch Init method from PythonEngine";
113-
return;
113+
return;
114114
}
115115

116116
pn_args->shutdown = getMethodFromClass(pythonengine, pn_args->shutdown_name);
117117
if (!pn_args->shutdown) {
118118
pn_args->error = "Unable to fetch shutdown method from PythonEngine";
119-
return;
119+
return;
120120
}
121121

122122
mono_runtime_invoke(init, NULL, NULL, &exception);
123123
if (exception) {
124124
pn_args->error = "An exception was raised";
125-
return;
125+
return;
126126
}
127127
}

0 commit comments

Comments
 (0)