Discussion:
[Pyzo] magic command namespace
n***@anodyne-solutions.com
2017-03-08 12:13:12 UTC
Permalink
I have only just started using pyzo as a general purpose on windows and linux. Is there a way to disable or re-map magic commands specifically 'db' as it clashes with another namespace? Currently using pyzo as a general purpose python IDE. Shell config is it? I'd prefer 'debug' instead of 'db' as I get an error when I use 'db.test' (for a mongoclient connection) and yes I know I could just not do it... just askin' don't flame me.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2017-03-09 11:51:25 UTC
Permalink
Hi,

No, the names of the magic commands are pretty hard-coded, so you’d have to edit pyzo/pyzokernel/magic.py. One idea might be to allow a percentage sign in front of the magic command, like IPython does. That way it is possible to unambiguously use a magic command.

Regards,
Almar


From: ***@anodyne-solutions.com
Sent: 08 March 2017 14:02
To: Pyzo
Subject: [Pyzo] magic command namespace

I have only just started using pyzo as a general purpose on windows and linux. Is there a way to disable or re-map magic commands specifically 'db' as it clashes with another namespace? Currently using pyzo as a general purpose python IDE. Shell config is it? I'd prefer 'debug' instead of 'db' as I get an error when I use 'db.test' (for a mongoclient connection) and yes I know I could just not do it... just askin' don't flame me.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Niall Farrington
2017-03-09 20:09:02 UTC
Permalink
Hey Almar,

Yep my bad I should have thought/guessed. I'll ruminate on a solution but
just patching it would be good enough. If I think of anything
better/extensible I'll submit something to git.

Thanks
Post by a***@gmail.com
Hi,
No, the names of the magic commands are pretty hard-coded, so you’d have
to edit pyzo/pyzokernel/magic.py. One idea might be to allow a percentage
sign in front of the magic command, like IPython does. That way it is
possible to unambiguously use a magic command.
Regards,
Almar
*Sent: *08 March 2017 14:02
*To: *Pyzo <javascript:>
*Subject: *[Pyzo] magic command namespace
I have only just started using pyzo as a general purpose on windows and
linux. Is there a way to disable or re-map magic commands specifically 'db'
as it clashes with another namespace? Currently using pyzo as a general
purpose python IDE. Shell config is it? I'd prefer 'debug' instead of 'db'
as I get an error when I use 'db.test' (for a mongoclient connection) and
yes I know I could just not do it... just askin' don't flame me.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2017-03-09 22:10:18 UTC
Permalink
Don’t worry, it’s always ok to ask! Looking forward to a PR, though if you prefer a quick-n-dirty local patch that’s fine :)

Regards,
Almar

From: Niall Farrington
Sent: 09 March 2017 21:09
To: Pyzo
Cc: ***@anodyne-solutions.com
Subject: Re: [Pyzo] magic command namespace

Hey Almar,

Yep my bad I should have thought/guessed. I'll ruminate on a solution but just patching it would be good enough. If I think of anything better/extensible I'll submit something to git.

Thanks

On Thursday, 9 March 2017 11:51:27 UTC, Almar Klein wrote:
Hi,
 
No, the names of the magic commands are pretty hard-coded, so you’d have to edit pyzo/pyzokernel/magic.py.  One idea might be to allow a percentage sign in front of the magic command, like IPython does. That way it is possible to unambiguously use a magic command.
 
Regards,
  Almar
 
 
From: ***@anodyne-solutions.com
Sent: 08 March 2017 14:02
To: Pyzo
Subject: [Pyzo] magic command namespace
 
I have only just started using pyzo as a general purpose on windows and linux. Is there a way to disable or re-map magic commands specifically 'db' as it clashes with another namespace? Currently using pyzo as a general purpose python IDE. Shell config is it? I'd prefer 'debug' instead of 'db' as I get an error when I use 'db.test' (for a mongoclient connection) and yes I know I could just not do it... just askin' don't flame me.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Niall Farrington
2017-03-10 10:00:07 UTC
Permalink
I am just going to get over it because we could empower people to define
their own aliases or add a shell.config, to not import magic or do whatever
but it simply isn't worth adding all that bloat when I can just use
'my.test' instead of 'db.test'. Imagine the hell when people messed up
their configs or renamed things they shouldn't? It would degrade the
overall quality of the application and make it more difficult to maintain
and support. I should stop being such a cut-paste monkey. I'm not even
going to patch as I should just get used to it. The magic commands are
really useful (especially pip for the forgetful) as switching windows
breaks my train of thought.

I'm really loving pyzo btw - geany was my IDE before - hated all the rest.
My first python came with OpenCaldera Linux in 1997 so I've seen few. I
don't think I've even scratched the surface yet. It's simplicity belies its
power like a $2 wrench. It is really TDD friendly too.

Thanks.
Post by n***@anodyne-solutions.com
I have only just started using pyzo as a general purpose on windows and
linux. Is there a way to disable or re-map magic commands specifically 'db'
as it clashes with another namespace? Currently using pyzo as a general
purpose python IDE. Shell config is it? I'd prefer 'debug' instead of 'db'
as I get an error when I use 'db.test' (for a mongoclient connection) and
yes I know I could just not do it... just askin' don't flame me.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2017-03-11 13:50:38 UTC
Permalink
No, if we’d do anything w.r.t magic commands, I’d say we make it possible to prefix them with the percent sign so the can be used even if a variable with the same name as the command exists. In other words, allow doing “%db start” in addition to “db start”.
Post by Niall Farrington
I'm really loving pyzo btw
Thanks, that’s always nice to hear :)

From: Niall Farrington
Sent: 10 March 2017 11:00
To: Pyzo
Subject: [Pyzo] Re: magic command namespace

I am just going to get over it because we could empower people to define their own aliases or add a shell.config, to not import magic or do whatever but it simply isn't worth adding all that bloat when I can just use 'my.test' instead of 'db.test'. Imagine the hell when people messed up their configs or renamed things they shouldn't? It would degrade the overall quality of the application and make it more difficult to maintain and support. I should stop being such a cut-paste monkey. I'm not even going to patch as I should just get used to it. The magic commands are really useful (especially pip for the forgetful) as switching windows breaks my train of thought.  

I'm really loving pyzo btw - geany was my IDE before - hated all the rest. My first python came with OpenCaldera Linux in 1997 so I've seen few. I don't think I've even scratched the surface yet. It's simplicity belies its power like a $2 wrench. It is really TDD friendly too. 

Thanks.

 
On Wednesday, 8 March 2017 13:02:06 UTC, Niall Farrington wrote:
I have only just started using pyzo as a general purpose on windows and linux. Is there a way to disable or re-map magic commands specifically 'db' as it clashes with another namespace? Currently using pyzo as a general purpose python IDE. Shell config is it? I'd prefer 'debug' instead of 'db' as I get an error when I use 'db.test' (for a mongoclient connection) and yes I know I could just not do it... just askin' don't flame me.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...