##// END OF EJS Templates
merged from trunk
Barry Wark -
r1318:39354d06 merge
parent child Browse files
Show More
@@ -40,7 +40,7 b' from pprint import saferepr'
40 40
41 41 import IPython
42 42 from IPython.kernel.engineservice import ThreadedEngineService
43 from IPython.frontend.frontendbase import AsynchronousFrontEndBase
43 from IPython.frontend.frontendbase import AsyncFrontEndBase
44 44
45 45 from twisted.internet.threads import blockingCallFromThread
46 46 from twisted.python.failure import Failure
@@ -96,14 +96,14 b' class AutoreleasePoolWrappedThreadedEngineService(ThreadedEngineService):'
96 96 return d
97 97
98 98
99 class IPythonCocoaController(NSObject, AsynchronousFrontEndBase):
99 class IPythonCocoaController(NSObject, AsyncFrontEndBase):
100 100 userNS = objc.ivar() #mirror of engine.user_ns (key=>str(value))
101 101 waitingForEngine = objc.ivar().bool()
102 102 textView = objc.IBOutlet()
103 103
104 104 def init(self):
105 105 self = super(IPythonCocoaController, self).init()
106 AsynchronousFrontEndBase.__init__(self,
106 AsyncFrontEndBase.__init__(self,
107 107 engine=AutoreleasePoolWrappedThreadedEngineService())
108 108 if(self != None):
109 109 self._common_init()
@@ -200,13 +200,14 b' class IPythonCocoaController(NSObject, AsynchronousFrontEndBase):'
200 200 result = blockingCallFromThread(self.engine.pull, keys)
201 201 self.waitingForEngine = False
202 202
203 def executeFileAtPath_(self, path):
203 @objc.signature('v@:@I')
204 def executeFileAtPath_encoding_(self, path, encoding):
204 205 """Execute file at path in an empty namespace. Update the engine
205 206 user_ns with the resulting locals."""
206 207
207 208 lines,err = NSString.stringWithContentsOfFile_encoding_error_(
208 209 path,
209 NSString.defaultCStringEncoding(),
210 encoding,
210 211 None)
211 212 self.engine.execute(lines)
212 213
@@ -11,7 +11,7 b''
11 11 isa = PBXContainerItemProxy;
12 12 containerPortal = 4C96F4FE0E199AB500B03430 /* Project object */;
13 13 proxyType = 1;
14 remoteGlobalIDString = 4C96F50C0E199AF100B03430 /* Cocoa Frontend Plugin */;
14 remoteGlobalIDString = 4C96F50C0E199AF100B03430;
15 15 remoteInfo = "Cocoa Frontend Plugin";
16 16 };
17 17 /* End PBXContainerItemProxy section */
@@ -355,7 +355,7 b' class FrontEndBase(object):'
355 355
356 356
357 357
358 class AsynchronousFrontEndBase(FrontEndBase):
358 class AsyncFrontEndBase(FrontEndBase):
359 359 """
360 360 Overrides FrontEndBase to wrap execute in a deferred result.
361 361 All callbacks are made as callbacks on the deferred result.
@@ -19,7 +19,7 b' import unittest'
19 19 from IPython.frontend import frontendbase
20 20 from IPython.kernel.engineservice import EngineService
21 21
22 class FrontEndCallbackChecker(frontendbase.AsynchronousFrontEndBase):
22 class FrontEndCallbackChecker(frontendbase.AsyncFrontEndBase):
23 23 """FrontEndBase subclass for checking callbacks"""
24 24 def __init__(self, engine=None, history=None):
25 25 super(FrontEndCallbackChecker, self).__init__(engine=engine,
@@ -44,7 +44,7 b' class FrontEndCallbackChecker(frontendbase.AsynchronousFrontEndBase):'
44 44
45 45
46 46
47 class TestAsynchronousFrontendBase(unittest.TestCase):
47 class TestAsyncFrontendBase(unittest.TestCase):
48 48 def setUp(self):
49 49 """Setup the EngineService and FrontEndBase"""
50 50
@@ -53,7 +53,7 b' class TestAsynchronousFrontendBase(unittest.TestCase):'
53 53
54 54 def test_implements_IFrontEnd(self):
55 55 assert(frontendbase.IFrontEnd.implementedBy(
56 frontendbase.AsynchronousFrontEndBase))
56 frontendbase.AsyncFrontEndBase))
57 57
58 58
59 59 def test_is_complete_returns_False_for_incomplete_block(self):
@@ -16,7 +16,6 b' graft IPython/tools'
16 16 graft docs
17 17 exclude docs/\#*
18 18 exclude docs/man/*.1
19 exclude docs/ChangeLog.*
20 19
21 20 # There seems to be no way of excluding whole subdirectories, other than
22 21 # manually excluding all their subdirs. distutils really is horrible...
@@ -124,7 +124,11 b' def find_package_data():'
124 124 """
125 125 # This is not enough for these things to appear in an sdist.
126 126 # We need to muck with the MANIFEST to get this to work
127 package_data = {'IPython.UserConfig' : ['*'] }
127 package_data = {
128 'IPython.UserConfig' : ['*'],
129 'IPython.tools.tests' : ['*.txt'],
130 'IPython.testing' : ['*.txt']
131 }
128 132 return package_data
129 133
130 134
General Comments 0
You need to be logged in to leave comments. Login now