Great, thanks. I've just finished packaging oranj, and looking back I think
it would definitely be better if I didn't mess with the packaging for
bpython :).

- Pavel Panchekha


On Wed, May 27, 2009 at 4:41 AM, Bob Farrell <
[email protected]> wrote:

>
> Hi Pavel,
>
> Good to hear from you again. :)
>
> I know very little about packaging - I believe nDuff (freenode IRC nick)
> did
> the packaging for me, though I could be mistaken - perhaps he would be the
> man
> to talk to ? I'll try to track him down and see if I can interest him in
> doing
> a little more work.
>
> I'll post here when I know more.
>
> On Tue, May 26, 2009 at 10:17:46AM -0700, Pavel Panchekha wrote:
> >
> > I've tested it a bit, and I think its ready to be merged, AFTER
> > someone who knows packaging fixes the setup script.
> >
> > First of all, it has to correctly copy the new languages package.
> > Second of all, it has to not place this in an egg file - other
> > languages will eventually be added, hopefully by a pure cp into the
> > bpython/languages/ directory.
> >
> > On May 15, 5:54 am, Bob Farrell <[email protected]>
> > wrote:
> > > Okay, I'll probably take a look tonight and see if I can spot any
> problems -
> > > just let me know when you think it's ready to go upstream and we'll
> sort it
> > > out.
> > >
> > > On Thu, May 14, 2009 at 03:13:12PM -0700, Pavel Panchekha wrote:
> > >
> > > > Committed changes to my bpython fork. Likely, these changes can be
> > > > committed to upstream, but its probably better to test them. I
> suspect
> > > > that it may be best not to include oranj support for the main
> bpython,
> > > > but instead do the following:
> > >
> > > > Move the python.py file to a languages package within the bpython
> > > > folder
> > > > Add a command line switch -l which takes an argument, a language
> name,
> > > > and imports languages.xxx as language. Then, one could install
> > > > additional languages by dumping their files into that directory.
> > >
> > > > This would fix several problems associated with the current oranj
> > > > support (it requires oranj itself, which is currently hard to
> install)
> > > > and also means not distributing other modules such as OranjLexer.
> > >
> > > > I'll spend a bit more time looking for changes to make (I think that
> > > > there are a few more things to language-agnostify), and then
> hopefully
> > > > prepare a nice patch / ask for commit privilages.
> > >
> > > > On May 13, 8:18 pm, Bob Farrell <[email protected]
> >
> > > > wrote:
> > > > > So, after a long time trying to get everything running (largely due
> to being
> > > > > distracted on IRC, granted), I managed to track down and fix the
> problems.
> > >
> > > > > Before I start, I'd like to say I'm really impressed with the work
> you've done
> > > > > - I nearly had a shit fit when I saw you'd gutted all of the
> attribute lookup
> > > > > stuff and wondered why on earth you were surprised it was not
> working, and then
> > > > > noticed the "python" module and dependency injection stuff you're
> doing. So,
> > > > > good work !
> > >
> > > > > Now, here's why you weren't finding the problem:
> > > > >         try:
> > > > >             self.completer.complete(cw, 0)
> > > > >         except Exception:
> > > > > # This sucks, but it's either that or list all the exceptions that
> could
> > > > > # possibly be raised here, so if anyone wants to do that, feel free
> to send me
> > > > > # a patch. XXX: Make sure you raise here if you're debugging the
> completion
> > > > > # stuff !
> > >
> > > > > Unfortunately, given that all kinds of exceptions can occur during
> completion
> > > > > stuff (since we're letting the user execute code inside our
> program), a long
> > > > > time ago I resigned to just catching "Exception" and dealing with
> it -
> > > > > TypeError, ValueError, blah blah blah, can all be raised. So,
> unless you do a
> > > > > "raise" in that except block, anything that goes wrong in the
> completion stuff
> > > > > will be ignored and you won't see any legitimate bugs in the code.
> > >
> > > > > In this case, firstly the "types" module hadn't been imported in
> python.py,
> > > > > secondly "matches" doesn't get defined here if attr_lookup fails
> (this is
> > > > > technically a bug in my code):
> > > > >     try:
> > > > >         matches = attr_lookup(obj, expr, attr)
> > > > >     finally:
> > > > >         # Dark magic:
> > > > >         if __getattribute__ is not None:
> > > > >             setattr(type_, '__getattribute__', __getattribute__)
> > > > >         if __getattr__ is not None:
> > > > >             setattr(type_, '__getattr__', __getattr__)
> > > > >         # /Dark magic
> > > > >         return matches
> > >
> > > > > so that raises a NameError, and thridly, "expr" and "attr" weren't
> being passed
> > > > > in to get_obj_attrs, so they were undefined too. attr_matches now
> passes them
> > > > > in:
> > >
> > > > >     def attr_matches(self, text):
> > > > >         """Taken from rlcompleter.py and bent to my will."""
> > >
> > > > >         m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
> > > > >         if not m:
> > > > >             return []
> > >
> > > > >         expr, attr = m.group(1, 3)
> > > > >         obj = eval(expr, self.interp.locals)
> > >
> > > > >         s = language.get_obj_attrs(obj, expr, attr)
> > > > >         return s
> > >
> > > > > (Previously just did "language.get_obj_attrs(obj)").
> > >
> > > > > Okay ! So, I've attached a patch; everything seems to work fine
> now; hopefully
> > > > > you'll be able to use what I've done to get it working with oranj -
> just make
> > > > > sure to raise that exception I mentioned !
> > >
> > > > > Oh, and that "foo(" stuff in the completion list is pretty cool;
> looking
> > > > > forward to pulling that upstream.
> > >
> > > > > As far as I can tell everything's ready to go as-is as far as
> pulling changes
> > > > > upstream goes. Once we've got that done I'm happy to give you
> commit privs to
> > > > > the main bpython repo so you can push your changes there directly -
> you've done
> > > > > a great job on the language-agnostic front. Can you think of
> anything that's
> > > > > preventing me pulling upstream now ? I'll let you get back to me
> before I do
> > > > > anything.
> > >
> > > > > On Wed, May 13, 2009 at 12:01:12PM -0700, Pavel Panchekha wrote:
> > >
> > > > > > Committed new revision to oranj. Try to redownload it and modify
> the
> > > > > > file src/objects/about.py to the installation path (or just read
> the
> > > > > > INSTALL file).
> > >
> > > > > > I'll get a build script up and running for that at some point.
> > >
> > > > > > On May 13, 5:19 pm, Bob Farrell <
> [email protected]>
> > > > > > wrote:
> > > > > > > Been fighting for a while now to get this working but there are
> a some missing
> > > > > > > dependencies.
> > >
> > > > > > > I'm guessing this:
> > > > > > >    http://code.activestate.com/recipes/475116/
> > > > > > > is the "terminal" module.
> > >
> > > > > > > No idea what the "files" module is, but it's looking for that
> too, and I really
> > > > > > > need to get out of the office now. I might take a look at this
> later but
> > > > > > > ideally if you could get this working in a --no-site-packages
> virtualenv and
> > > > > > > list any dependencies on the bitbucket.org wiki (or include
> any extra deps in
> > > > > > > the distribution) that'd be great.
> > >
> > > > > > > Nice work, though - good to see you're taking the right
> approach with keeping
> > > > > > > bpython agnostic. Once we figure out what's up with the
> attribute lookup issue
> > > > > > > (which I can probably diagnose by just using bpython without
> the --oranj flag)
> > > > > > > I'll do some testing and then I see no problem pulling your
> changes upstream.
> > >
> > > > > > > On Wed, May 13, 2009 at 08:20:32AM -0700, Pavel Panchekha
> wrote:
> > >
> > > > > > > >http://bitbucket.org/pavpanchekha/bpython-oranj/
> > >
> > > > > > > > Python is now a bit broken (no attr matching), oranj just as
> good (use
> > > > > > > > --oranj command line flag).
> > >
> > > > > > > > Because I've yet to make a build system thing for oranj, the
> following
> > > > > > > > directory tree is required:
> > >
> > > > > > > > oranj
> > > > > > > >  - folder
> > > > > > > >    - bpython
> > > > > > > >  - src
> > > > > > > >  - ...
> > >
> > > > > > > > folder can be called anything.
> > >
> > > > > > > > I should really fix that.
> > >
> > > > > > > > On May 13, 2:22 pm, Bob Farrell <
> [email protected]>
> > > > > > > > wrote:
> > > > > > > > > Well, there's some hideously dark magic that goes on with
> the autocompletion
> > > > > > > > > stuff which you might want to bypass. Feel free to send a
> patch over (or,
> > > > > > > > > ideally, if you can fork the bpython project on
> bitbucket.org so I can pull and
> > > > > > > > > push without having to worry about emailing patch files
> around) and I'll take a
> > > > > > > > > look. I'm at work, may as well do something interesting. :)
> > >
> > > > > > > > > On Wed, May 13, 2009 at 05:58:47AM -0700, Pavel Panchekha
> wrote:
> > >
> > > > > > > > > > Hmm. I have it mostly working, but I seem to have
> completely broken
> > > > > > > > > > attribute matching. Don't know why, and can't seem to be
> able to debug
> > > > > > > > > > anything. If you want, I can send you a patch as it is
> now, maybe you
> > > > > > > > > > will understand better than me. Don't want to waste your
> time though.
> > >
> > > > > > > > > > What I have right now is that I split out all of the
> language specific
> > > > > > > > > > stuff completely, and everything but the attribute
> matching works (Oh,
> > > > > > > > > > and I haven't tested rewind, but that shouldn't be a
> problem).
> > >
> > > > > > > > > > On May 13, 9:46 am, Bob Farrell <
> [email protected]>
> > > > > > > > > > wrote:
> > > > > > > > > > > Hi Pavel,
> > >
> > > > > > > > > > > On Tue, May 12, 2009 at 05:58:13PM -0700, Pavel
> Panchekha wrote:
> > >
> > > > > > > > > > > > Having a bit of trouble here with the color
> formatting. The
> > > > > > > > > > > > BPythonFormatter works (mostly, had to fix it up a
> bit) but there's
> > > > > > > > > > > > another issue.
> > >
> > > > > > > > > > > > When Oranj prints error messages, it'd be nice if
> they were colored.
> > > > > > > > > > > > They already are when using the console, but I need
> to use the curses
> > > > > > > > > > > > color codes for printing in the bpython.
> > >
> > > > > > > > > > > > What I'm doing is this:
> > >
> > > > > > > > > > > > msg = "\x01r\x03%s\x01d\x03%s" % (type(e).__name__,
> ("" if not e.args
> > > > > > > > > > > > else (": " + " ".join(map(str, e.args)))))
> > >
> > > > > > > > > > > > Ideally, this should make the first bit
> (type(e).__name__) red and the
> > > > > > > > > > > > other bit normal gray colored (Its the error
> message). This isn't
> > > > > > > > > > > > working, however - the entire line is red.
> > >
> > > > > > > > > > > I thought this was already possible, but turns out it
> wasn't - I've changed the
> > > > > > > > > > > code so that you can achieve what you were aiming for
> now by doing this:
> > > > > > > > > > >     msg = "\x01r\x03what\x04\x01d\x03hello"
> > > > > > > > > > > and then passing that to Repl.write, which will now
> split on \x04 - you'll have
> > > > > > > > > > > to pull from the hg repo to get the latest changes, or
> just use this:
> > >
> > > > > > > > > > >     def write(self, s):
> > > > > > > > > > >         """For overriding stdout defaults"""
> > > > > > > > > > >         if '\x04' in s:
> > > > > > > > > > >             for block in s.split('\x04'):
> > > > > > > > > > >                 self.write(block)
> > > > > > > > > > >             return
> > > > > > > > > > >         if s.rstrip() and '\x03' in s:
> > > > > > > > > > >
> > >
> > > ...
> > >
> > > read more ยป
> > >
>
> --
> Bob Farrell
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"bpython" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/bpython?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to