rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
try: data = float_array(toplot) except TypeError:
data = float_array(data) assert len(data.shape) == 2 (numx, numy) = data.shape if xvals is None: xvals = Numeric.arange(numx) else:
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py
(numx,) = xvals.shape
assert xvals.shape == (numx,) if yvals is None: yvals = Numeric.arange(numy) else:
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py
(numy,) = yvals.shape try: data = toplot(xvals,yvals) except: data = grid_function(toplot, xvals, yvals) else: assert len(data.shape) == 2 (numx, numy) = data.shape if xvals is None: xvals = Numeric.arange(numx) else: xvals = float_array(xvals) assert xvals.shape == (numx,) if yvals is None: yvals = Numeric.ara...
assert yvals.shape == (numy,)
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py
inline = not binary and _prefer_inline_data
inline = (not binary) and _prefer_inline_data
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py
raw_input('Please press return to continue...\n') def f(x,y): import math print x,y return math.exp(- 0.01 * (x**2 + y**2)) g.splot(GridFunc(f, x,y, binary=0))
def demo(): """Demonstrate the package.""" from Numeric import * # A straightforward use of gnuplot. The `debug=1' switch is used # in these examples so that the commands that are sent to gnuplot # are also output on stderr. g = Gnuplot(debug=1) g.title('A simple example') # (optional) g('set data style linespoints'...
a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py
g = Gnuplot.Gnuplot()
g = Gnuplot.Gnuplot(debug=1)
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = Gnuplot.Gnuplot() g.clear() # Make a temporary file: filename1 = tempfile.mktemp() f = open(filename1, 'w') for x in Numeric.arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x))) f.close(...
c594720b9d2cb4ea5ec390f594a6bcc95ec4e254 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/c594720b9d2cb4ea5ec390f594a6bcc95ec4e254/test.py
def float_array(m): """Return the argument as a Numeric array of type at least 'Float32'. Leave 'Float64' unchanged, but upcast all other types to 'Float32'. Allow also for the possibility that the argument is a python native type that can be converted to a Numeric array using 'Numeric.asarray()', but in that case do...
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
def grid_function(f, xvals, yvals, typecode=Numeric.Float32):
def grid_function(f, xvals, yvals, typecode=None, ufunc=0):
def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i...
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
Note that 'f' is evaluated at each pair of points using a Python loop, which can be slow if the number of points is large. If speed is an issue, you should if possible compute functions matrix-wise using Numeric's built-in ufuncs.
If 'ufunc=0', then 'f' is evaluated at each pair of points using a Python loop. This can be slow if the number of points is large. If speed is an issue, you should write 'f' in terms of Numeric ufuncs and use the 'ufunc=1' feature described next. If called with 'ufunc=1', then 'f' should be a function that is compose...
def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i...
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
m = Numeric.zeros((len(xvals), len(yvals)), typecode) for xi in range(len(xvals)): x = xvals[xi] for yi in range(len(yvals)): y = yvals[yi] m[xi,yi] = f(x,y) return m
xvals = Numeric.asarray(xvals, typecode) yvals = Numeric.asarray(yvals, typecode) if ufunc: return f(xvals[:,Numeric.NewAxis], yvals[Numeric.NewAxis,:]) else: m = Numeric.zeros((len(xvals), len(yvals)), xvals.typecode()) for xi in range(len(xvals)): x = xvals[xi] for yi in range(len(yvals)): y = yvals[yi] m[xi,yi] = ...
def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i...
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
If 'binary=1' is passed to the constructor, the data will be passed to gnuplot in binary format and the 'binary' option added to the splot command line. Binary format is faster and usually saves disk space but is not human-readable. If your version of gnuplot doesn't support binary format (it is a recently-added feat...
def pipein(self, f): if self._data: f.write(self._data)
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
def __init__(self, toplot, xvals=None, yvals=None,
def __init__(self, data, xvals=None, yvals=None,
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
'toplot' -- the thing to plot: a 2-d array with dimensions (numx,numy), OR a callable object for which toplot(x,y) returns a number.
'data' -- the data to plot: a 2-d array with dimensions (numx,numy).
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
'toplot' can be a data array, in which case it should hold the values of a function f(x,y) tabulated on a grid of points, such that 'toplot[i,j] == f(xvals[i], yvals[j])'. If 'xvals' and/or 'yvals' are omitted, integers (starting with 0) are used for that coordinate. The data are written to a temporary file; no copy ...
'data' must be a data array holding the values of a function f(x,y) tabulated on a grid of points, such that 'data[i,j] == f(xvals[i], yvals[j])'. If 'xvals' and/or 'yvals' are omitted, integers (starting with 0) are used for that coordinate. The data are written to a temporary file; no copy of the data is kept in me...
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
f(x,y)' triplets that can be used by gnuplot's 'splot' command. If 'binary=1' then the data are written to a file in a binary format that 'splot' can understand.
f(x,y)' triplets (y changes most rapidly) that can be used by gnuplot's 'splot' command. Blank lines are included each time the value of x changes so that gnuplot knows to plot a surface through the data. If 'binary=1' then the data are written to a file in a binary format that 'splot' can understand. Binary format ...
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
try: data = float_array(toplot) except TypeError:
data = float_array(data) assert len(data.shape) == 2 (numx, numy) = data.shape if xvals is None: xvals = Numeric.arange(numx) else:
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
(numx,) = xvals.shape
assert xvals.shape == (numx,) if yvals is None: yvals = Numeric.arange(numy) else:
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
(numy,) = yvals.shape try: data = toplot(xvals,yvals) except: data = grid_function(toplot, xvals, yvals) else: assert len(data.shape) == 2 (numx, numy) = data.shape if xvals is None: xvals = Numeric.arange(numx) else: xvals = float_array(xvals) assert xvals.shape == (numx,) if yvals is None: yvals = Numeric.ara...
assert yvals.shape == (numy,)
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
inline = not binary and _prefer_inline_data
inline = (not binary) and _prefer_inline_data
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
raw_input('Please press return to continue...\n') def f(x,y): import math print x,y return math.exp(- 0.01 * (x**2 + y**2)) g.splot(GridFunc(f, x,y, binary=0))
def demo(): """Demonstrate the package.""" from Numeric import * # A straightforward use of gnuplot. The `debug=1' switch is used # in these examples so that the commands that are sent to gnuplot # are also output on stderr. g = Gnuplot(debug=1) g.title('A simple example') # (optional) g('set data style linespoints'...
57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py
m = Numeric.zeros((len(xvals), len(yvals)), xvals.typecode())
if typecode is None: typecode = (Numeric.zeros((1,), xvals.typecode()) + Numeric.zeros((1,), yvals.typecode())).typecode() m = Numeric.zeros((len(xvals), len(yvals)), typecode)
def grid_function(f, xvals, yvals, typecode=None, ufunc=0): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i,j...
258feb822091a6e1d14d98bf4c9519fc7ab46704 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/258feb822091a6e1d14d98bf4c9519fc7ab46704/__init__.py
class OptionException(Exception): pass
class OptionException(Exception): pass class DataException(Exception): pass
def test_persist(): global _recognizes_persist if _recognizes_persist is None: g = os.popen('echo | gnuplot -persist 2>&1', 'r') response = g.readlines() g.close() _recognizes_persist = ((not response) or (string.find(response[0], '-persist') == -1)) return _recognizes_persist
7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28/__init__.py
if item.shape[1] == 1: newitems.append(Data(item, with='lines'))
dim = len(item.shape) if dim == 1: newitems.append(Data(item[:, Numeric.NewAxis], with='lines')) elif dim == 2: if item.shape[1] == 1: newitems.append(Data(item, with='lines')) else: tempf = TempArrayFile(item) for col in range(1, item.shape[1]): newitems.append(File(tempf, using=(1,col+1), with='lines'))
def plot(*items, **kw): """plot data using gnuplot. This command is roughly compatible with old Gnuplot plot command. It is provided for backwards compatibility only. It is recommended that you use the new object-oriented Gnuplot interface, which is much more flexible. It can only plot Numeric array data. In this r...
7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28/__init__.py
tempf = TempArrayFile(item) for col in range(1, item.shape[1]): newitems.append(File(tempf, using=(1,col+1), with='lines'))
raise DataException("Data array must be 1 or 2 dimensional")
def plot(*items, **kw): """plot data using gnuplot. This command is roughly compatible with old Gnuplot plot command. It is provided for backwards compatibility only. It is recommended that you use the new object-oriented Gnuplot interface, which is much more flexible. It can only plot Numeric array data. In this r...
7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28/__init__.py
print "\n Generating postscript file 'junk.ps'\n" g2.hardcopy('junk.ps', color=1)
print "\n Generating postscript file 'gnuplot_test1.ps'\n" g2.hardcopy('gnuplot_test1.ps', color=1)
def plot(*items, **kw): """plot data using gnuplot. This command is roughly compatible with old Gnuplot plot command. It is provided for backwards compatibility only. It is recommended that you use the new object-oriented Gnuplot interface, which is much more flexible. It can only plot Numeric array data. In this r...
7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/7bd6aaf1fba9fb8c5d2b240c922a5fafb53eaa28/__init__.py
write_array(f, set[0], item_sep, nest_prefix, nest_suffix, nest_sep)
write_array(f, set[0], item_sep, nest_prefix, nest_suffix, nest_sep)
def write_array(f, set, item_sep=' ', nest_prefix='', nest_suffix='\n', nest_sep=''): """Write an array of arbitrary dimension to a file. A general recursive array writer. The last four parameters allow a great deal of freedom in choosing the output format of the array. The defaults for those parameters give output ...
0a4f7548fadcad2f9565bf390a8db9021c445c01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/0a4f7548fadcad2f9565bf390a8db9021c445c01/__init__.py
write_array(f, subset, item_sep, nest_prefix, nest_suffix, nest_sep)
write_array(f, subset, item_sep, nest_prefix, nest_suffix, nest_sep)
def write_array(f, set, item_sep=' ', nest_prefix='', nest_suffix='\n', nest_sep=''): """Write an array of arbitrary dimension to a file. A general recursive array writer. The last four parameters allow a great deal of freedom in choosing the output format of the array. The defaults for those parameters give output ...
0a4f7548fadcad2f9565bf390a8db9021c445c01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/0a4f7548fadcad2f9565bf390a8db9021c445c01/__init__.py
set = Numeric.asarray(set, Numeric.Float)
set = Numeric.asarray(set[0], Numeric.Float)
def __init__(self, *set, **keyw): """Construct a Data object from a numeric array.
0a4f7548fadcad2f9565bf390a8db9021c445c01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/0a4f7548fadcad2f9565bf390a8db9021c445c01/__init__.py
for x in arange(100)/5. - 10.:
for x in Numeric.arange(100)/5. - 10.:
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x...
b178b63500ad8ddc95ff1deab692672e287234a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/b178b63500ad8ddc95ff1deab692672e287234a7/test.py
x = arange(100)/5. - 10.
x = Numeric.arange(100)/5. - 10.
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x...
b178b63500ad8ddc95ff1deab692672e287234a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/b178b63500ad8ddc95ff1deab692672e287234a7/test.py
x = arange(35)/2.0 y = arange(30)/10.0 - 1.5
x = Numeric.arange(35)/2.0 y = Numeric.arange(30)/10.0 - 1.5
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x...
b178b63500ad8ddc95ff1deab692672e287234a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/b178b63500ad8ddc95ff1deab692672e287234a7/test.py
m = (sin(xm) + 0.1*xm) - ym**2
m = (Numeric.sin(xm) + 0.1*xm) - ym**2
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x...
b178b63500ad8ddc95ff1deab692672e287234a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/b178b63500ad8ddc95ff1deab692672e287234a7/test.py
g.splot(gp.GridFunc(lambda x,y: sin(x) + 0.1*x - y**2, x,y))
g.splot(gp.GridFunc(lambda x,y: math.sin(x) + 0.1*x - y**2, x,y))
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x...
b178b63500ad8ddc95ff1deab692672e287234a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/b178b63500ad8ddc95ff1deab692672e287234a7/test.py
g.splot(gp.GridFunc(lambda x,y: sin(x) + 0.1*x - y**2, x,y,
g.splot(gp.GridFunc(lambda x,y: Numeric.sin(x) + 0.1*x - y**2, x,y,
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x...
b178b63500ad8ddc95ff1deab692672e287234a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/b178b63500ad8ddc95ff1deab692672e287234a7/test.py
class file(plotitem): """a plotitem representing a file that contains gnuplot data.""" _option_list = plotitem._option_list.copy()
class File(PlotItem): """A PlotItem representing a file that contains gnuplot data.""" _option_list = PlotItem._option_list.copy()
def __del__(self): """Delete the referenced file."""
1ad1a64c1cb68257b9fa744cb8c97d06c68365e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/1ad1a64c1cb68257b9fa744cb8c97d06c68365e4/PlotItems.py
'smooth', smooth, none, 'smooth %s'),
'smooth', smooth, None, 'smooth %s'),
def __del__(self): """Delete the referenced file."""
1ad1a64c1cb68257b9fa744cb8c97d06c68365e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/1ad1a64c1cb68257b9fa744cb8c97d06c68365e4/PlotItems.py
"""construct a file object.
"""Construct a File object.
def __init__(self, file, **keyw): """construct a file object.
1ad1a64c1cb68257b9fa744cb8c97d06c68365e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/1ad1a64c1cb68257b9fa744cb8c97d06c68365e4/PlotItems.py
m = Numeric.zeros((len(xvals), len(yvals)), xvals.typecode())
if typecode is None: typecode = (Numeric.zeros((1,), xvals.typecode()) + Numeric.zeros((1,), yvals.typecode())).typecode() m = Numeric.zeros((len(xvals), len(yvals)), typecode)
def grid_function(f, xvals, yvals, typecode=None, ufunc=0): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i,j...
00d69a5d46dfd4ca8a49405782e5026dbd616146 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/00d69a5d46dfd4ca8a49405782e5026dbd616146/__init__.py
print setterm
def hardcopy(self, filename=None, terminal='postscript', **keyw): """Create a hardcopy of the current plot.
4ec7f7ccdbbbc2de8039496974278560dddc17ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/4ec7f7ccdbbbc2de8039496974278560dddc17ce/_Gnuplot.py
super( D20Damage, self ).__init__( 'Damage', 0, self.range.roll )
super( D20Damage, self ).__init__( 'Damage', 0, self.__int__ )
def __init__( self, types, size=0, roll="1d8", range=None ): self.range = range or D20DamageRange( size, roll ) self.types = types super( D20Damage, self ).__init__( 'Damage', 0, self.range.roll ) self.mod.static = True
207ed87faf315ab793ddacf4ee0ecdc556ae8941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/207ed87faf315ab793ddacf4ee0ecdc556ae8941/d20rep.py
bob = D20Character( "Bob", race, { 'STR': 13, 'DEX':15, 'CON':12, 'INT':10, 'WIS':8, 'CHA':18, 'HEIGHT':72, 'WEIGHT':221, 'WIDTH':24, 'DEPTH':12 } )
bob = D20Character( "Bob", race, { 'STR': 150, 'DEX':15, 'CON':12, 'INT':10, 'WIS':8, 'CHA':18, 'HEIGHT':72, 'WEIGHT':221, 'WIDTH':24, 'DEPTH':12 } )
def getLevel( self ): charlevelnum = 1 try: for level in self.levels[ 'RACE' ].values( ): if level.enabled: charlevelnum += 1 except KeyError: pass return charlevelnum
207ed87faf315ab793ddacf4ee0ecdc556ae8941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/207ed87faf315ab793ddacf4ee0ecdc556ae8941/d20rep.py
dmg = att.resolve( 18 )
dmg = att.resolve( 19, 1 ) """
def getLevel( self ): charlevelnum = 1 try: for level in self.levels[ 'RACE' ].values( ): if level.enabled: charlevelnum += 1 except KeyError: pass return charlevelnum
207ed87faf315ab793ddacf4ee0ecdc556ae8941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/207ed87faf315ab793ddacf4ee0ecdc556ae8941/d20rep.py
def loadAliases(): try: aliases = pickle.load(file(fs.aliases('aliases.pkl'), 'rb')) log.msg('loaded aliases') except IOError, e: # if the file just doesn't exist, assume we have to create it. if e.errno == errno.ENOENT: log.msg('new aliases.pkl') else: raise
fc65a124a44c0abf2a6a8cf2dce93804d881e048 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/fc65a124a44c0abf2a6a8cf2dce93804d881e048/alias.py
self.canvas.set_size_request(self.bg.get_width(), self.bg.get_height())
def __init__(self, deferred, netclient, fps): self.fps = fps self.deferred = deferred self.netclient = netclient
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
self.canvas.root().add("GnomeCanvasPixbuf", pixbuf=self.bg, )
self.tiles = []
def __init__(self, deferred, netclient, fps): self.fps = fps self.deferred = deferred self.netclient = netclient
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
def __init__(self, deferred, netclient, fps): self.fps = fps self.deferred = deferred self.netclient = netclient
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
self.canvas.connect('size-allocate', self.on_canvas_expose_event)
def __init__(self, deferred, netclient, fps): self.fps = fps self.deferred = deferred self.netclient = netclient
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
def paintDefault(self):
def on_canvas_expose_event(self, w, ev):
def paintDefault(self): """Draw the default background""" tile_w = self.bg.get_width() tile_h = self.bg.get_height() # tile the texture root = self.canvas.root() if self.model is None: # root.add("GnomeCanvasPixbuf", x=0, y=0, # pixbuf=self.bg) #root.add("GnomeCanvasPixbuf", x=-129, y=0, # pixbuf=...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
tile_w = self.bg.get_width() tile_h = self.bg.get_height()
def paintDefault(self): """Draw the default background""" tile_w = self.bg.get_width() tile_h = self.bg.get_height() # tile the texture root = self.canvas.root() if self.model is None: # root.add("GnomeCanvasPixbuf", x=0, y=0, # pixbuf=self.bg) #root.add("GnomeCanvasPixbuf", x=-129, y=0, # pixbuf=...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
root.add("GnomeCanvasRect", x1=0, x2=384, y1=0, y2=384, fill_color="blue", outline_color="black") root.add("GnomeCanvasText", x=0, y=0, text="0,0") root.add("GnomeCanvasText", x=300, y=300, text="300,300") root.add("GnomeCanvasText", x=0, y=300, text="0,300") root.add("GnomeCanvasText", x=300, y=0, text="300,0") re...
tile_w = self.bg.get_width() tile_h = self.bg.get_height() view_w = self.gw_scrolledwindow1.get_hadjustment().page_size view_h = self.gw_scrolledwindow1.get_vadjustment().page_size num_x = (view_w / tile_w) + 1 num_y = (view_h / tile_h) + 1 [w.destroy() for w in self.tiles] self.tiles = []
def paintDefault(self): """Draw the default background""" tile_w = self.bg.get_width() tile_h = self.bg.get_height() # tile the texture root = self.canvas.root() if self.model is None: # root.add("GnomeCanvasPixbuf", x=0, y=0, # pixbuf=self.bg) #root.add("GnomeCanvasPixbuf", x=-129, y=0, # pixbuf=...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
root.add("GnomeCanvasPixbuf",
w = root.add("GnomeCanvasPixbuf",
def paintDefault(self): """Draw the default background""" tile_w = self.bg.get_width() tile_h = self.bg.get_height() # tile the texture root = self.canvas.root() if self.model is None: # root.add("GnomeCanvasPixbuf", x=0, y=0, # pixbuf=self.bg) #root.add("GnomeCanvasPixbuf", x=-129, y=0, # pixbuf=...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
FIXME
if self.tiles: [w.destroy() for w in self.tiles] self.tiles = []
def paintDefault(self): """Draw the default background""" tile_w = self.bg.get_width() tile_h = self.bg.get_height() # tile the texture root = self.canvas.root() if self.model is None: # root.add("GnomeCanvasPixbuf", x=0, y=0, # pixbuf=self.bg) #root.add("GnomeCanvasPixbuf", x=-129, y=0, # pixbuf=...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
self.model = Model(pygame.image.load(fs.downloads(mapinfo['name']))) self.main.blit(self.model.background, (0,0))
background = gdk.pixbuf_new_from_file(fs.downloads(mapinfo['name'])) self.model = Model(background) root = self.canvas.root() root.add("GnomeCanvasPixbuf", pixbuf=background) self.canvas.set_size_request(background.get_width(), background.get_height() )
def displayModel(self): mapinfo = self._getMapInfo() log.msg('displaying map %s' % (mapinfo['name'],)) self.model = Model(pygame.image.load(fs.downloads(mapinfo['name']))) self.main.blit(self.model.background, (0,0)) for n, character in enumerate(self._getCharacterInfo()): icon_image = pygame.image.load(fs.downloads(ch...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
icon_image = pygame.image.load(fs.downloads(character['name']))
icon_image = gdk.pixbuf_new_from_file( fs.downloads(character['name']) )
def displayModel(self): mapinfo = self._getMapInfo() log.msg('displaying map %s' % (mapinfo['name'],)) self.model = Model(pygame.image.load(fs.downloads(mapinfo['name']))) self.main.blit(self.model.background, (0,0)) for n, character in enumerate(self._getCharacterInfo()): icon_image = pygame.image.load(fs.downloads(ch...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
self.main.blit(icon.image, icon.xy)
self.canvas.root().add("GnomeCanvasPixbuf", pixbuf=icon.image, x=icon.xy[0], y=icon.xy[1], )
def displayModel(self): mapinfo = self._getMapInfo() log.msg('displaying map %s' % (mapinfo['name'],)) self.model = Model(pygame.image.load(fs.downloads(mapinfo['name']))) self.main.blit(self.model.background, (0,0)) for n, character in enumerate(self._getCharacterInfo()): icon_image = pygame.image.load(fs.downloads(ch...
b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/b678ac7eff46d2af5d07c3c0b6b3064a0f4ca389/frontend.py
groups=args.split()
groups = args.split()
def irccmd_join(self, args, conv): groups=args.split()
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
args=args[len(groups[0])-1:].lstrip() groups=groups[0].split(',') groups=[conv.group.account.getGroup(group.lstrip('
args = args[len(groups[0])-1:].lstrip() acct = conv.group.account groups = groups[0].split(',') groups = [acct.getGroup(group.lstrip('
def irccmd_join(self, args, conv): groups=args.split()
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
irccmd_j=irccmd_join
irccmd_j = irccmd_join
def irccmd_join(self, args, conv): groups=args.split()
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
groups=args.split() ircgroups=[]
groups = args.split() ircgroups = []
def irccmd_part(self, args, conv): groups=args.split() ircgroups=[]
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
args=args[len(groups[0])-1:].lstrip() groups=groups[0].split(',')
args = args[len(groups[0])-1:].lstrip() groups = groups[0].split(',')
def irccmd_part(self, args, conv): groups=args.split() ircgroups=[]
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
name=group.lstrip('
name = group.lstrip('
def irccmd_part(self, args, conv): groups=args.split() ircgroups=[]
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
irccmd_leave=irccmd_part
irccmd_leave = irccmd_part
def irccmd_part(self, args, conv): groups=args.split() ircgroups=[]
f5f4c4cc763305a9c877458f820e84ec3bc8fd3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f5f4c4cc763305a9c877458f820e84ec3bc8fd3d/ajazz.py
tabs = IChatConversations(widget) self.webPrint = lambda m: tabs.printClean(m, self.person.name)
def __init__(self, widget, *a, **kw): components.Componentized.__init__(self) basechat.Conversation.__init__(self, *a, **kw) self.widget = widget tabs = IChatConversations(widget) self.webPrint = lambda m: tabs.printClean(m, self.person.name)
06c8966914958e7880646f44df34f9428860bdf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/06c8966914958e7880646f44df34f9428860bdf3/minchat.py
return self.webPrint(t)
return ITextArea(self).printClean(t)
def showMessage(self, text, metadata=None): if metadata and metadata.get("style", None) == "emote": t = '* %s %s' % (self.person.name, text) else: t = "<%s> %s" % (self.person.name, text) return self.webPrint(t)
06c8966914958e7880646f44df34f9428860bdf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/06c8966914958e7880646f44df34f9428860bdf3/minchat.py
return self.webPrint(event)
return ITextArea(self).printClean(event)
def contactChangedNick(self, person, newnick): basechat.Conversation.contactChangedNick(self, person, newnick) event = "-!- %s is now known as %s" % (person.name, newnick) return self.webPrint(event)
06c8966914958e7880646f44df34f9428860bdf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/06c8966914958e7880646f44df34f9428860bdf3/minchat.py
self.webPrint(out)
ITextArea(self).printClean(out)
def sendText(self, text, metadata=None): r = self.person.sendMessage(text, metadata) me = self.person.account.client.name if metadata and metadata.get('style', None) == 'emote': out = u'* %s %s' % (me, text) else: out = u'<%s> %s' % (me, text) self.webPrint(out)
06c8966914958e7880646f44df34f9428860bdf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/06c8966914958e7880646f44df34f9428860bdf3/minchat.py
scale100px = A.point4decimal("Distance in meters of 100 map px @ 100% zoom")
scale100px = A.point4decimal()
def installOn(self, other): other.powerUp(self, IArticle)
d5eefebb25a3b5b35e33a74b8c97a59c9ca38386 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/d5eefebb25a3b5b35e33a74b8c97a59c9ca38386/data.py
('MFen', 'VellumTalk', 'MFen', '{100x2}', r'MFen, you rolled: 100x2 = {100, 100} \(sorted\)'),
def clientConnectionFailed(self, connector, reason): print "connection failed:", reason reactor.stop()
09b8a4088ccf5a2bfa81b5e2c8f115f15cb16b02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/09b8a4088ccf5a2bfa81b5e2c8f115f15cb16b02/irc.py
def clientConnectionFailed(self, connector, reason): print "connection failed:", reason reactor.stop()
09b8a4088ccf5a2bfa81b5e2c8f115f15cb16b02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/09b8a4088ccf5a2bfa81b5e2c8f115f15cb16b02/irc.py
def __init__(self, chatui): self.chatui = chatui
a789faa1e4b879086cb75dae348f7250b22252de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/a789faa1e4b879086cb75dae348f7250b22252de/minchat.py
acct = VellumIRCAccount("IRC", 1, username, password, host,
acct = ircsupport.IRCAccount("IRC", 1, username, password, host,
def doConnection(self, host, username, password, channels): if username in ACCOUNTS and ACCOUNTS[username].isOnline(): self.disconnect(ACCOUNTS[username])
a789faa1e4b879086cb75dae348f7250b22252de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/a789faa1e4b879086cb75dae348f7250b22252de/minchat.py
self.webPrint = lambda m: widget.printClean(self.group.name, m)
self.webPrint = lambda m: widget.printClean('
def __init__(self, widget, *a, **kw): basechat.GroupConversation.__init__(self, *a, **kw) self.widget = widget self.webPrint = lambda m: widget.printClean(self.group.name, m)
a789faa1e4b879086cb75dae348f7250b22252de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/a789faa1e4b879086cb75dae348f7250b22252de/minchat.py
if self.group.name in self.widget.conversations:
groupname = ' if groupname in self.widget.conversations:
def show(self): """If you don't have a GUI, this is a no-op. """ if self.group.name in self.widget.conversations: self.widget.foregroundConversation = self self.widget.callRemote("show", unicode(self.group.name))
a789faa1e4b879086cb75dae348f7250b22252de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/a789faa1e4b879086cb75dae348f7250b22252de/minchat.py
self.widget.callRemote("show", unicode(self.group.name))
self.widget.callRemote("show", unicode(groupname))
def show(self): """If you don't have a GUI, this is a no-op. """ if self.group.name in self.widget.conversations: self.widget.foregroundConversation = self self.widget.callRemote("show", unicode(self.group.name))
a789faa1e4b879086cb75dae348f7250b22252de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/a789faa1e4b879086cb75dae348f7250b22252de/minchat.py
loadAliases()
loadAliases()
def __init__(self, *args, **kwargs): loadAliases() self.encounters = [] self.party = encounter.Encounter() self.wtf = 0 # number of times a "wtf" has occurred recently. # reset wtf's every 30 seconds self.resetter = task.LoopingCall(self._resetWtfCount).start(30.0)
3a401177ccf5e5a80618a5ccf4cc63351c212265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/3a401177ccf5e5a80618a5ccf4cc63351c212265/irc.py
class Zoom(Operation):
class Magnify(Operation):
def update(self, x, y): ha = self.gui.canvas.get_hadjustment() va = self.gui.canvas.get_vadjustment()
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
_d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
x1 = self.drawn.get_property('x1') y1 = self.drawn.get_property('y1') x2 = self.drawn.get_property('x2') y2 = self.drawn.get_property('y2')
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
current_w = alloc.width current_h = alloc.height box_w = abs(_d['x2'] - _d['x1']) box_h = abs(_d['y2'] - _d['y1']) ratio_w = current_w / box_w ratio_h = current_h / box_h
box_w = abs(x2 - x1) box_h = abs(y2 - y1) ratio_w = alloc.width / box_w ratio_h = alloc.height / box_h
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
current_zoom = 10.0 / canvas.c2w(10, 10)[0]
last_zoom = 10.0 / canvas.c2w(10, 10)[0]
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
zoom = current_zoom
zoom = last_zoom
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
if _d['x1'] < _d['x2']: west = _d['x1'] else: west = _d['x2'] if _d['y1'] < _d['y2']: north = _d['y1'] else: north = _d['y2'] hadj, vadj = canvas.w2c(west, north)
if x1 < x2: west = x1 if y1 < y2: north = y1
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
x_offset = hadj y_offset = vadj + box_h/2 - (alloc.height/2 * zoom)
x_offset = west y_offset = north - (alloc.height - box_h) / 2
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
y_offset = vadj x_offset = hadj + box_w/2 - (alloc.width/2 * zoom)
x_offset = west - (alloc.width - box_w) / 2 y_offset = north
def finish(self): """Zoom so the inscribed area is maximized in the main window""" if self.drawn: _d = {} for point in ('x1', 'y1', 'x2', 'y2'): _d[point] = self.drawn.get_property(point)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
def update(self, x, y): if self.drawn: self.drawn.destroy() # FIXME - when bx > x, swap bx/by with x/y x, y = self.gui.canvas.c2w(x, y) bx, by = self.gui.canvas.c2w(self.begin_x, self.begin_y)
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
'zoom_on': Zoom,
'magnify_on': Magnify,
def __init__(self, deferred, netclient, fps): self.fps = fps self.deferred = deferred self.netclient = netclient
9ca00bcf59233e3e96a8b8b1413433ca982f39f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/9ca00bcf59233e3e96a8b8b1413433ca982f39f9/frontend.py
'Tabby': _f('tab.js'), 'Tabby.Tests': _f('livetest_tab.js')
'Tabby': _f('tabs.js'), 'Tabby.Tests': _f('livetest_tabs.js'),
def _f(*sib): return util.sibpath(webby.__file__, '/'.join(sib))
406d88ef8101b77ad54ca8b7f49a360cbfb82f2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/406d88ef8101b77ad54ca8b7f49a360cbfb82f2c/webbypackage.py
log.msg('|||'.join(prefix, command, params))
log.msg('|||'.join((prefix, command, params)))
def irc_unknown(self, prefix, command, params): log.msg('|||'.join(prefix, command, params))
2562020447cf349330ad28ca3b2083882cf9d2e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/2562020447cf349330ad28ca3b2083882cf9d2e9/irc.py
acct = proto.WebbyAccount('%s@%s' % key,
acct = WebbyAccount('%s@%s' % key,
def doConnection(self, host, username, password, channels): key = (username, host) if key in ACCOUNTS and ACCOUNTS[key].isOnline(): self.disconnect(ACCOUNTS[key])
bb05985127b7357665d1c21721b52fde34acbe27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/bb05985127b7357665d1c21721b52fde34acbe27/minchat.py
def render_debug(self, ctx, data): f = athena.IntrospectionFragment() f.setFragmentParent(self) return ctx.tag[f]
def render_debug(self, ctx, data): f = athena.IntrospectionFragment() f.setFragmentParent(self) return ctx.tag[f]
6aaee2f917e07651bdba3bc6232f414bb91ac523 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/6aaee2f917e07651bdba3bc6232f414bb91ac523/ajazz.py
print "3 !!!!!!!!!!!!!!!!!!!!!!! abstract connectionLost", self
def connectionLost(self, reason): """ Basically, t.words.im.basesupport.AbstractClientMixin is completely *fucked* in the head. Subclassing it is impossible, because of the stupid fucking self._protoBase, which turns out to be IRCProto, not this class.
bd7688b062fee1d35b9a0b34f0eba0d99206355b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/bd7688b062fee1d35b9a0b34f0eba0d99206355b/proto.py
self.__dict__['observers'] = []
self.observers = []
def __init__(self): self.__dict__['observers'] = []
aaec1b3c6b4a0e495e447cec7ada7c320474b1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/aaec1b3c6b4a0e495e447cec7ada7c320474b1c1/mvc.py
def __setattr__(self, name, value): raise RuntimeError("Assignments must be made through an Arbiter.")
def __setattr__(self, name, value): raise RuntimeError("Assignments must be made through an Arbiter.")
aaec1b3c6b4a0e495e447cec7ada7c320474b1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/aaec1b3c6b4a0e495e447cec7ada7c320474b1c1/mvc.py
old = getattr(n, name, None)
def __setattr__(self, name, value): n = self.noumenon old = getattr(n, name, None)
aaec1b3c6b4a0e495e447cec7ada7c320474b1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/aaec1b3c6b4a0e495e447cec7ada7c320474b1c1/mvc.py
if name in self.noumenon.__phenomena__: return getattr(self.noumenon, name) raise AttributeError(name)
return getattr(self.noumenon, name)
def __getattr__(self, name): if name in self.noumenon.__phenomena__: return getattr(self.noumenon, name) raise AttributeError(name)
aaec1b3c6b4a0e495e447cec7ada7c320474b1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/aaec1b3c6b4a0e495e447cec7ada7c320474b1c1/mvc.py
h = Hork()
h = Hork().getArbiter('ROOT')
def bar_changed(self, tag, model, old, new): output.append(('bar', old, new, tag))
aaec1b3c6b4a0e495e447cec7ada7c320474b1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/aaec1b3c6b4a0e495e447cec7ada7c320474b1c1/mvc.py
try: h.foo = 1 except RuntimeError, e: pass else: assert 0, "should not be able to assign to h.foo"
def bar_changed(self, tag, model, old, new): output.append(('bar', old, new, tag))
aaec1b3c6b4a0e495e447cec7ada7c320474b1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/aaec1b3c6b4a0e495e447cec7ada7c320474b1c1/mvc.py
print 'TODO: fit'
alloc = self.canvas.get_allocation() _, _, canv_w, canv_h = self.canvas.get_scroll_region() ratio_w = alloc.width / canv_w ratio_h = alloc.height / canv_h self.canvas.set_pixels_per_unit(min([ratio_w, ratio_h]))
def on_zoomfit_activate(self, widget): if self.canvas: print 'TODO: fit'
f1b45be713e16c99ceaa43b59d1f3f3bde618732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/f1b45be713e16c99ceaa43b59d1f3f3bde618732/frontend.py
log.msg('|||'.join((prefix, command, params)))
log.msg('|||'.join((prefix, command, repr(params))))
def irc_unknown(self, prefix, command, params): log.msg('|||'.join((prefix, command, params)))
a3c64010051392197f8367d7c8be40cb5ac588e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/a3c64010051392197f8367d7c8be40cb5ac588e6/irc.py
dispatcher.connect(self.receivePropertyChange, self) def receivePropertyChange(self, property, value): setattr(self, property, value)
self.receiver = lambda property,value:setattr(self, property, value) dispatcher.connect(self.receiver, self)
def __init__(self): dispatcher.connect(self.receivePropertyChange, self)
780f2d4c1840616da1641fc2081dc5c02dee259e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/780f2d4c1840616da1641fc2081dc5c02dee259e/model.py
assert None, "begin must be implemented in a subclass"
pass
def begin(self): assert None, "begin must be implemented in a subclass"
bcbfa4e1f582b47498cec1f1ef0411a1110c4a5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/bcbfa4e1f582b47498cec1f1ef0411a1110c4a5b/frontend.py