Show More
@@ -19,17 +19,17 b' __docformat__ = "restructuredtext en"' | |||
|
19 | 19 | from setuptools import setup |
|
20 | 20 | |
|
21 | 21 | infoPlist = dict( |
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
22 | CFBundleDevelopmentRegion='English', | |
|
23 | CFBundleIdentifier='org.scipy.ipython.cocoa_frontend', | |
|
24 | NSPrincipalClass='IPythonCocoaController', | |
|
25 | 25 | ) |
|
26 | 26 | |
|
27 | 27 | setup( |
|
28 |
|
|
|
28 | plugin=['IPythonCocoaFrontendLoader.py'], | |
|
29 | 29 | setup_requires=['py2app'], |
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 | )), | |
|
30 | options=dict(py2app=dict( | |
|
31 | plist=infoPlist, | |
|
32 | site_packages=True, | |
|
33 | excludes=['IPython','twisted','PyObjCTools'] | |
|
34 | )), | |
|
35 | 35 | ) No newline at end of file |
@@ -44,7 +44,7 b' class _Helper(object):' | |||
|
44 | 44 | |
|
45 | 45 | def __call__(self, *args, **kwds): |
|
46 | 46 | class DummyWriter(object): |
|
47 |
'''Dumy class to handle help output''' |
|
|
47 | '''Dumy class to handle help output''' | |
|
48 | 48 | def __init__(self, pager): |
|
49 | 49 | self._pager = pager |
|
50 | 50 |
@@ -76,12 +76,12 b' class WxNonBlockingIPShell(NonBlockingIPShell):' | |||
|
76 | 76 | """ A replacement from python's raw_input. |
|
77 | 77 | """ |
|
78 | 78 | self.answer = None |
|
79 |
if(self._threading == True): |
|
|
80 |
|
|
|
81 |
|
|
|
82 | time.sleep(.1) | |
|
79 | if(self._threading == True): | |
|
80 | wx.CallAfter(self._yesNoBox, prompt) | |
|
81 | while self.answer is None: | |
|
82 | time.sleep(.1) | |
|
83 | 83 | else: |
|
84 |
|
|
|
84 | self._yesNoBox(prompt) | |
|
85 | 85 | return self.answer |
|
86 | 86 | |
|
87 | 87 | def _yesNoBox(self, prompt): |
@@ -111,7 +111,7 b' def fix_error_editor(self,filename,linenum,column,msg):' | |||
|
111 | 111 | |
|
112 | 112 | # vds: >> |
|
113 | 113 | def synchronize_with_editor(self, filename, linenum, column): |
|
114 | pass | |
|
114 | pass | |
|
115 | 115 | # vds: << |
|
116 | 116 | |
|
117 | 117 | class CommandChainDispatcher: |
@@ -45,10 +45,10 b' def skipif(skip_condition=True, msg=None):' | |||
|
45 | 45 | Parameters |
|
46 | 46 | ---------- |
|
47 | 47 | skip_condition : bool or callable. |
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
48 | Flag to determine whether to skip test. If the condition is a | |
|
49 | callable, it is used at runtime to dynamically make the decision. This | |
|
50 | is useful for tests that may require costly imports, to delay the cost | |
|
51 | until the test suite is actually executed. | |
|
52 | 52 | msg : string |
|
53 | 53 | Message to give on raising a SkipTest exception |
|
54 | 54 |
@@ -21,7 +21,7 b' from twisted.internet import defer' | |||
|
21 | 21 | class DeferredTestCase(unittest.TestCase): |
|
22 | 22 | |
|
23 | 23 | def assertDeferredEquals(self, deferred, expectedResult, |
|
24 |
|
|
|
24 | chainDeferred=None): | |
|
25 | 25 | """Calls assertEquals on the result of the deferred and expectedResult. |
|
26 | 26 | |
|
27 | 27 | chainDeferred can be used to pass in previous Deferred objects that |
@@ -32,7 +32,7 b' class DeferredTestCase(unittest.TestCase):' | |||
|
32 | 32 | |
|
33 | 33 | if chainDeferred is None: |
|
34 | 34 | chainDeferred = defer.succeed(None) |
|
35 |
|
|
|
35 | ||
|
36 | 36 | def gotResult(actualResult): |
|
37 | 37 | self.assertEquals(actualResult, expectedResult) |
|
38 | 38 | |
@@ -41,7 +41,7 b' class DeferredTestCase(unittest.TestCase):' | |||
|
41 | 41 | return chainDeferred.addCallback(lambda _: deferred) |
|
42 | 42 | |
|
43 | 43 | def assertDeferredRaises(self, deferred, expectedException, |
|
44 |
|
|
|
44 | chainDeferred=None): | |
|
45 | 45 | """Calls assertRaises on the Failure of the deferred and expectedException. |
|
46 | 46 | |
|
47 | 47 | chainDeferred can be used to pass in previous Deferred objects that |
@@ -1,18 +1,32 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """Utility to look for hard tabs and \r characters in all sources. |
|
3 | ||
|
4 | Usage: | |
|
5 | ||
|
6 | ./check_sources.py | |
|
7 | ||
|
8 | It prints summaries and if chosen, line-by-line info of where \\t or \\r | |
|
9 | characters can be found in our source tree. | |
|
3 | 10 | """ |
|
4 | 11 | |
|
5 | from IPython.external.path import path | |
|
12 | # Config | |
|
13 | # If true, all lines that have tabs are printed, with line number | |
|
14 | full_report_tabs = True | |
|
15 | # If true, all lines that have tabs are printed, with line number | |
|
16 | full_report_rets = False | |
|
6 | 17 | |
|
7 | fs = path('..').walkfiles('*.py') | |
|
18 | # Code begins | |
|
19 | from IPython.external.path import path | |
|
8 | 20 | |
|
9 | 21 | rets = [] |
|
22 | tabs = [] | |
|
10 | 23 | |
|
11 | for f in fs: | |
|
24 | for f in path('..').walkfiles('*.py'): | |
|
12 | 25 | errs = '' |
|
13 | 26 | cont = f.bytes() |
|
14 | 27 | if '\t' in cont: |
|
15 | 28 | errs+='t' |
|
29 | tabs.append(f) | |
|
16 | 30 | |
|
17 | 31 | if '\r' in cont: |
|
18 | 32 | errs+='r' |
@@ -20,13 +34,21 b' for f in fs:' | |||
|
20 | 34 | |
|
21 | 35 | if errs: |
|
22 | 36 | print "%3s" % errs, f |
|
23 | if 't' in errs: | |
|
24 | for ln,line in enumerate(f.lines()): | |
|
25 | if '\t' in line: | |
|
26 | print 'TAB:',ln,':',line, | |
|
27 | if 'r' in errs: | |
|
28 | for ln,line in enumerate(open(f.abspath(),'rb')): | |
|
29 | if '\r' in line: | |
|
30 | print 'RET:',ln,':',line, | |
|
31 | ||
|
32 | rr = rets[-1] | |
|
37 | ||
|
38 | if 't' in errs and full_report_tabs: | |
|
39 | for ln,line in enumerate(f.lines()): | |
|
40 | if '\t' in line: | |
|
41 | print 'TAB:',ln,':',line, | |
|
42 | ||
|
43 | if 'r' in errs and full_report_rets: | |
|
44 | for ln,line in enumerate(open(f.abspath(),'rb')): | |
|
45 | if '\r' in line: | |
|
46 | print 'RET:',ln,':',line, | |
|
47 | ||
|
48 | # Summary at the end, to call cleanup tools if necessary | |
|
49 | if tabs: | |
|
50 | print 'Hard tabs found. These can be cleaned with untabify:' | |
|
51 | for f in tabs: print f, | |
|
52 | if rets: | |
|
53 | print 'Carriage returns (\\r) found in:' | |
|
54 | for f in rets: print f, |
General Comments 0
You need to be logged in to leave comments.
Login now