From 521434d96fbf44cb8aec9fcfeb45c07c56c36c16 Mon Sep 17 00:00:00 2001
From: Michael Dryden <mdryden@chem.utoronto.ca>
Date: Fri, 6 Jun 2014 21:29:36 -0600
Subject: [PATCH] Removed extra files. Configured Xcode to build cython modules
 and added a setup script.

---
 dstatInterface/dstat.py                       | 12 ----
 .../dstatInterface.xcodeproj/project.pbxproj  |  6 +-
 .../xcschemes/dstatInterface copy.xcscheme    | 59 -------------------
 .../xcschemes/dstatInterface.xcscheme         | 13 +++-
 dstatInterface/setup.py                       |  6 ++
 5 files changed, 20 insertions(+), 76 deletions(-)
 delete mode 100644 dstatInterface/dstat.py
 delete mode 100644 dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface copy.xcscheme
 create mode 100644 dstatInterface/setup.py

diff --git a/dstatInterface/dstat.py b/dstatInterface/dstat.py
deleted file mode 100644
index fbf776b..0000000
--- a/dstatInterface/dstat.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-from multiprocessing import Pool
-
-def f(x):
-    return x*x
-
-if __name__ == '__main__':
-    pool = Pool(processes=4)              # start 4 worker processes
-    result = pool.apply_async(f, [10])    # evaluate "f(10)" asynchronously
-    print result.get(timeout=1)           # prints "100" unless your computer is *very* slow
-    print pool.map(f, range(10))          # prints "[0, 1, 4,..., 81]"
\ No newline at end of file
diff --git a/dstatInterface/dstatInterface.xcodeproj/project.pbxproj b/dstatInterface/dstatInterface.xcodeproj/project.pbxproj
index 31bd7dc..6371382 100644
--- a/dstatInterface/dstatInterface.xcodeproj/project.pbxproj
+++ b/dstatInterface/dstatInterface.xcodeproj/project.pbxproj
@@ -8,19 +8,19 @@
 
 /* Begin PBXFileReference section */
 		5F87883C19072E86007B53E0 /* mpltest.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = mpltest.py; sourceTree = "<group>"; };
-		5FB75EE819268F15006346E1 /* dstat.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = dstat.py; sourceTree = "<group>"; };
 		5FCB541B190591CD00CEB148 /* interface */ = {isa = PBXFileReference; lastKnownFileType = folder; path = interface; sourceTree = "<group>"; };
 		5FCB541D1905923800CEB148 /* interface_test.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = interface_test.py; sourceTree = "<group>"; };
 		5FCB54231905B6EE00CEB148 /* dstat_comm.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = dstat_comm.py; sourceTree = "<group>"; };
 		5FDC0DFD18FDAD79003F857A /* mpl.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = mpl.py; sourceTree = "<group>"; };
 		5FDC1E4218FF9572007AD04D /* glade1.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = glade1.py; sourceTree = "<group>"; };
+		5FF00FDC1942BD16004D38A8 /* setup.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = setup.py; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXGroup section */
 		5FDC0DF218FDACDA003F857A = {
 			isa = PBXGroup;
 			children = (
-				5FB75EE819268F15006346E1 /* dstat.py */,
+				5FF00FDC1942BD16004D38A8 /* setup.py */,
 				5F87883C19072E86007B53E0 /* mpltest.py */,
 				5FCB541D1905923800CEB148 /* interface_test.py */,
 				5FCB54231905B6EE00CEB148 /* dstat_comm.py */,
@@ -35,7 +35,7 @@
 /* Begin PBXLegacyTarget section */
 		5FDC0DF718FDACDA003F857A /* dstatInterface */ = {
 			isa = PBXLegacyTarget;
-			buildArgumentsString = "$(ACTION)";
+			buildArgumentsString = "setup.py build_ext --inplace";
 			buildConfigurationList = 5FDC0DFA18FDACDA003F857A /* Build configuration list for PBXLegacyTarget "dstatInterface" */;
 			buildPhases = (
 			);
diff --git a/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface copy.xcscheme b/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface copy.xcscheme
deleted file mode 100644
index 3054ac1..0000000
--- a/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface copy.xcscheme	
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "0510"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "5F43DA40192AE7B900CA81D7"
-               BuildableName = "dstatInterface copy"
-               BlueprintName = "clean"
-               ReferencedContainer = "container:dstatInterface.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      buildConfiguration = "Debug">
-      <Testables>
-      </Testables>
-   </TestAction>
-   <LaunchAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      buildConfiguration = "Debug"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      allowLocationSimulation = "YES">
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </LaunchAction>
-   <ProfileAction
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      buildConfiguration = "Release"
-      debugDocumentVersioning = "YES">
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>
diff --git a/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface.xcscheme b/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface.xcscheme
index 2384319..ddd1981 100644
--- a/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface.xcscheme
+++ b/dstatInterface/dstatInterface.xcodeproj/xcuserdata/mdryden.xcuserdatad/xcschemes/dstatInterface.xcscheme
@@ -41,11 +41,20 @@
       debugDocumentVersioning = "YES"
       allowLocationSimulation = "YES">
       <PathRunnable
-         FilePath = "/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7">
+         FilePath = "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7">
       </PathRunnable>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "5FDC0DF718FDACDA003F857A"
+            BuildableName = "dstatInterface"
+            BlueprintName = "dstatInterface"
+            ReferencedContainer = "container:dstatInterface.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
       <CommandLineArguments>
          <CommandLineArgument
-            argument = "main.py"
+            argument = "interface_test.py"
             isEnabled = "YES">
          </CommandLineArgument>
       </CommandLineArguments>
diff --git a/dstatInterface/setup.py b/dstatInterface/setup.py
new file mode 100644
index 0000000..56b5774
--- /dev/null
+++ b/dstatInterface/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+from Cython.Build import cythonize
+
+setup(
+      ext_modules = cythonize("*.pyx")
+      )
\ No newline at end of file
-- 
GitLab