Show More
@@ -2,9 +2,11 b'' | |||
|
2 | 2 | """Being removed |
|
3 | 3 | """ |
|
4 | 4 | |
|
5 | ||
|
5 | 6 | class LazyEvaluate(object): |
|
6 | 7 | """This is used for formatting strings with values that need to be updated |
|
7 | 8 | at that time, such as the current time or working directory.""" |
|
9 | ||
|
8 | 10 | def __init__(self, func, *args, **kwargs): |
|
9 | 11 | self.func = func |
|
10 | 12 | self.args = args |
@@ -16,6 +18,6 b' class LazyEvaluate(object):' | |||
|
16 | 18 | |
|
17 | 19 | def __str__(self): |
|
18 | 20 | return str(self()) |
|
19 | ||
|
21 | ||
|
20 | 22 | def __format__(self, format_spec): |
|
21 | 23 | return format(self(), format_spec) |
@@ -1,4 +1,4 b'' | |||
|
1 | 1 | # coding: iso-8859-5 |
|
2 | 2 | # (Unlikely to be the default encoding for most testers.) |
|
3 | 3 | # БЖџрстуфхцчшщъыьэюя <- Cyrillic characters |
|
4 |
|
|
|
4 | "Ўт№Ф" |
@@ -3,9 +3,9 b'' | |||
|
3 | 3 | Extra capabilities for IPython |
|
4 | 4 | """ |
|
5 | 5 | |
|
6 | #----------------------------------------------------------------------------- | |
|
6 | # ----------------------------------------------------------------------------- | |
|
7 | 7 | # Copyright (C) 2008-2011 The IPython Development Team |
|
8 | 8 | # |
|
9 | 9 | # Distributed under the terms of the BSD License. The full license is in |
|
10 | 10 | # the file COPYING, distributed as part of this software. |
|
11 | #----------------------------------------------------------------------------- | |
|
11 | # ----------------------------------------------------------------------------- |
@@ -1,10 +1,10 b'' | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | __docformat__ = "restructuredtext en" |
|
3 | #------------------------------------------------------------------------------- | |
|
3 | # ------------------------------------------------------------------------------- | |
|
4 | 4 | # Copyright (C) 2005 Fernando Perez <fperez@colorado.edu> |
|
5 | 5 | # Brian E Granger <ellisonbg@gmail.com> |
|
6 | 6 | # Benjamin Ragan-Kelley <benjaminrk@gmail.com> |
|
7 | 7 | # |
|
8 | 8 | # Distributed under the terms of the BSD License. The full license is in |
|
9 | 9 | # the file COPYING, distributed as part of this software. |
|
10 | #------------------------------------------------------------------------------- | |
|
10 | # ------------------------------------------------------------------------------- |
@@ -35,6 +35,7 b' def system(cmd):' | |||
|
35 | 35 | # Start up process: |
|
36 | 36 | reg = System.Diagnostics.Process.Start(psi) |
|
37 | 37 | |
|
38 | ||
|
38 | 39 | def getoutput(cmd): |
|
39 | 40 | """ |
|
40 | 41 | getoutput(cmd) should work in a cli environment on Mac OSX, Linux, |
@@ -53,6 +54,7 b' def getoutput(cmd):' | |||
|
53 | 54 | error = myError.ReadToEnd() |
|
54 | 55 | return output |
|
55 | 56 | |
|
57 | ||
|
56 | 58 | def check_pid(pid): |
|
57 | 59 | """ |
|
58 | 60 | Check if a process with the given PID (pid) exists |
@@ -66,4 +68,4 b' def check_pid(pid):' | |||
|
66 | 68 | return True |
|
67 | 69 | except System.ArgumentException: |
|
68 | 70 | # process with given pid isn't running |
|
69 |
return False |
|
|
71 | return False |
@@ -41,7 +41,7 b' def dir2(obj):' | |||
|
41 | 41 | # TypeError: dir(obj) does not return a list |
|
42 | 42 | words = set() |
|
43 | 43 | |
|
44 |
if safe_hasattr(obj, |
|
|
44 | if safe_hasattr(obj, "__class__"): | |
|
45 | 45 | words |= set(dir(obj.__class__)) |
|
46 | 46 | |
|
47 | 47 | # filter out non-string attributes which may be stuffed by dir() calls |
@@ -62,7 +62,7 b' def get_real_method(obj, name):' | |||
|
62 | 62 | Returns the method or None. |
|
63 | 63 | """ |
|
64 | 64 | try: |
|
65 |
canary = getattr(obj, |
|
|
65 | canary = getattr(obj, "_ipython_canary_method_should_not_exist_", None) | |
|
66 | 66 | except Exception: |
|
67 | 67 | return None |
|
68 | 68 |
General Comments 0
You need to be logged in to leave comments.
Login now