diff --git a/IPython/frontend/cocoa/cocoa_frontend.py b/IPython/frontend/cocoa/cocoa_frontend.py index a713a2e..df6cc3f 100644 --- a/IPython/frontend/cocoa/cocoa_frontend.py +++ b/IPython/frontend/cocoa/cocoa_frontend.py @@ -40,7 +40,7 @@ from pprint import saferepr import IPython from IPython.kernel.engineservice import ThreadedEngineService -from IPython.frontend.frontendbase import AsynchronousFrontEndBase +from IPython.frontend.frontendbase import AsyncFrontEndBase from twisted.internet.threads import blockingCallFromThread from twisted.python.failure import Failure @@ -96,14 +96,14 @@ class AutoreleasePoolWrappedThreadedEngineService(ThreadedEngineService): return d -class IPythonCocoaController(NSObject, AsynchronousFrontEndBase): +class IPythonCocoaController(NSObject, AsyncFrontEndBase): userNS = objc.ivar() #mirror of engine.user_ns (key=>str(value)) waitingForEngine = objc.ivar().bool() textView = objc.IBOutlet() def init(self): self = super(IPythonCocoaController, self).init() - AsynchronousFrontEndBase.__init__(self, + AsyncFrontEndBase.__init__(self, engine=AutoreleasePoolWrappedThreadedEngineService()) if(self != None): self._common_init() @@ -200,13 +200,14 @@ class IPythonCocoaController(NSObject, AsynchronousFrontEndBase): result = blockingCallFromThread(self.engine.pull, keys) self.waitingForEngine = False - def executeFileAtPath_(self, path): + @objc.signature('v@:@I') + def executeFileAtPath_encoding_(self, path, encoding): """Execute file at path in an empty namespace. Update the engine user_ns with the resulting locals.""" lines,err = NSString.stringWithContentsOfFile_encoding_error_( path, - NSString.defaultCStringEncoding(), + encoding, None) self.engine.execute(lines) diff --git a/IPython/frontend/cocoa/plugin/CocoaFrontendPlugin.xcodeproj/project.pbxproj b/IPython/frontend/cocoa/plugin/CocoaFrontendPlugin.xcodeproj/project.pbxproj index d544d70..525d6ef 100644 --- a/IPython/frontend/cocoa/plugin/CocoaFrontendPlugin.xcodeproj/project.pbxproj +++ b/IPython/frontend/cocoa/plugin/CocoaFrontendPlugin.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ isa = PBXContainerItemProxy; containerPortal = 4C96F4FE0E199AB500B03430 /* Project object */; proxyType = 1; - remoteGlobalIDString = 4C96F50C0E199AF100B03430 /* Cocoa Frontend Plugin */; + remoteGlobalIDString = 4C96F50C0E199AF100B03430; remoteInfo = "Cocoa Frontend Plugin"; }; /* End PBXContainerItemProxy section */ diff --git a/IPython/frontend/frontendbase.py b/IPython/frontend/frontendbase.py index bdc5495..e9c8fbb 100644 --- a/IPython/frontend/frontendbase.py +++ b/IPython/frontend/frontendbase.py @@ -355,7 +355,7 @@ class FrontEndBase(object): -class AsynchronousFrontEndBase(FrontEndBase): +class AsyncFrontEndBase(FrontEndBase): """ Overrides FrontEndBase to wrap execute in a deferred result. All callbacks are made as callbacks on the deferred result. diff --git a/IPython/frontend/tests/test_frontendbase.py b/IPython/frontend/tests/test_frontendbase.py index 1498036..f74c43e 100644 --- a/IPython/frontend/tests/test_frontendbase.py +++ b/IPython/frontend/tests/test_frontendbase.py @@ -19,7 +19,7 @@ import unittest from IPython.frontend import frontendbase from IPython.kernel.engineservice import EngineService -class FrontEndCallbackChecker(frontendbase.AsynchronousFrontEndBase): +class FrontEndCallbackChecker(frontendbase.AsyncFrontEndBase): """FrontEndBase subclass for checking callbacks""" def __init__(self, engine=None, history=None): super(FrontEndCallbackChecker, self).__init__(engine=engine, @@ -44,7 +44,7 @@ class FrontEndCallbackChecker(frontendbase.AsynchronousFrontEndBase): -class TestAsynchronousFrontendBase(unittest.TestCase): +class TestAsyncFrontendBase(unittest.TestCase): def setUp(self): """Setup the EngineService and FrontEndBase""" @@ -53,7 +53,7 @@ class TestAsynchronousFrontendBase(unittest.TestCase): def test_implements_IFrontEnd(self): assert(frontendbase.IFrontEnd.implementedBy( - frontendbase.AsynchronousFrontEndBase)) + frontendbase.AsyncFrontEndBase)) def test_is_complete_returns_False_for_incomplete_block(self): diff --git a/MANIFEST.in b/MANIFEST.in index 7fa5a4a..227736e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,7 +16,6 @@ graft IPython/tools graft docs exclude docs/\#* exclude docs/man/*.1 -exclude docs/ChangeLog.* # There seems to be no way of excluding whole subdirectories, other than # manually excluding all their subdirs. distutils really is horrible... diff --git a/setupbase.py b/setupbase.py index c1d9a3a..657596a 100644 --- a/setupbase.py +++ b/setupbase.py @@ -124,7 +124,11 @@ def find_package_data(): """ # This is not enough for these things to appear in an sdist. # We need to muck with the MANIFEST to get this to work - package_data = {'IPython.UserConfig' : ['*'] } + package_data = { + 'IPython.UserConfig' : ['*'], + 'IPython.tools.tests' : ['*.txt'], + 'IPython.testing' : ['*.txt'] + } return package_data