mattfoster / ipython-tmbundle

Useful commands for interacting with IPython from TextMate

This URL has Read+Write access

ipython-tmbundle / Commands / Add breakpoint.tmCommand
100644 40 lines (34 sloc) 1.037 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#! /usr/bin/env python
import sys, os
 
sys.path.append(os.environ['TM_BUNDLE_SUPPORT'] + '/lib')
from ipythonMate import *
 
try:
cmd=os.environ['TM_IPYTHON']
except KeyError:
cmd='ipython'
 
run_in_terminal('break $TM_FILEPATH:$TM_LINE_NUMBER', command=cmd)
 
text = ('Added breakpoint to: ' +
  os.path.basename(os.environ.get('TM_FILEPATH')) + ' on line ' +
  os.environ.get('TM_LINE_NUMBER'))
 
notify_with_growl("IPython Script", text)</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^I</string>
<key>name</key>
<string>Add breakpoint</string>
<key>output</key>
<string>discard</string>
<key>scope</key>
<string>source.python</string>
<key>uuid</key>
<string>CF1D8E92-F4D7-4E20-9376-0037D9552AA3</string>
</dict>
</plist>