9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Plumber rule for Python tracebacks
@ 2021-08-31  2:21 Ben Hancock
  0 siblings, 0 replies; only message in thread
From: Ben Hancock @ 2021-08-31  2:21 UTC (permalink / raw)
  To: 9fans

Hi 9fans,

I work with Python a lot, and after beginning to write code in acme, I
thought it would be neat to have a plumber rule to easily jump to the
origin of errors with Mouse-3. Here's what I came up with:

  # Easily jump to the origin of Python Tracebacks
  type is text
  data matches 'File \"([A-Za-z_\-\/]+\.py)\", line ([0-9]+)'
  arg isfile $1
  data set $file
  attr add addr=$2
  plumb to edit
  plumb client $editor

This may be obvious to many who are more experienced with acme, but I
figured I would share in case it's helpful. So far it works pretty well!
I don't often come across modules with numbers in the filename, but one
could add a 0-9 in the first regex to handle that as well.

I put this in $HOME/lib/plumber and make sure to start the plumber
before firing up acme.

Anyone else have any good tips for working with Python in acme?

Cheers,

- Ben

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T96499166b9ef2245-M07ba4887b2862957c74d6126
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-31  2:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31  2:21 [9fans] Plumber rule for Python tracebacks Ben Hancock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).