The scripts directory doesn't exist anymore. That was back when post-review
was a script that we directly installed, rather than being a Python module
that gets called. Going forward, post-review will be split into multiple
files, so it really needs to be installed and accessible as a proper Python
module.

Nowadays, easy_install wraps our rbtools.reviewboard module in an
auto-generated wrapper script when installing the egg. That thin wrapper
really just invokes postreview.main(), after setting up the proper python
paths. Your script can just do that, once you have things stored in the
correct place and the python path populated correctly.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Thu, May 12, 2011 at 4:48 PM, minkzanity <min...@gmail.com> wrote:

> Pathing isn't the issue because if I rename the egg, I get an error
> that it cannot be found at all.
>
> So I ran thru a debugger and found it was failing in pkg_resources.py:
>
>    def run_script(self,script_name,namespace):
>        script = 'scripts/'+script_name
>        if not self.has_metadata(script):
>             raise ResolutionError("No script named %r" % script_name)
>
> Inspecting the egg, there is no /scripts directory.  I opened the egg
> and moved files around and got it working.  I'm assuming this isn't
> meant to be.  Is there another method instead of
> pkg_resources.run_script() I should be using to call the script within
> the egg?  rbtools-0.2beta1-py2.6 does in fact have a /scripts
> directory.
>
>
>
> On May 12, 1:17 pm, Christian Hammond <chip...@chipx86.com> wrote:
> > Okay, well at this point it's an installation issue. It's not looking in
> the
> > right place for your postreview script. You're going to have to make sure
> > when you install it that it's all going into the right directory on the
> > share drive, and the paths are all correct. Right now, it's looking in
> your
> > C:\Python26, and I gather it should be on \\share instead.
> >
> > I can't quite give you exact advice here because it depends on your
> setup.
> >
> > Christian
> >
> > --
> > Christian Hammond - chip...@chipx86.com
> > Review Board -http://www.reviewboard.org
> > VMware, Inc. -http://www.vmware.com
> >
> >
> >
> > On Thu, May 12, 2011 at 12:47 PM, minkzanity <min...@gmail.com> wrote:
> > > Traceback (most recent call last):
> > >  File "\\share\post-review.py", line 24, in <module>
> > >     pkg_resources.run_script('rbtools==0.3.2', 'postreview')
> > >   File "C:\Python26\lib\site-packages\pkg_resources.py", line 489, in
> > > run_script
> > >    self.require(requires)[0].run_script(script_name, ns)
> > >  File "C:\Python26\lib\site-packages\pkg_resources.py", line 1201, in
> > > run_script
> > >    raise ResolutionError("No script named %r" % script_name)
> > > pkg_resources.ResolutionError: No script named 'postreview'
> >
> > > On May 12, 12:29 pm, Christian Hammond <chip...@chipx86.com> wrote:
> > > > Try 'postreview'
> >
> > > > Christian
> >
> > > > --
> > > > Christian Hammond - chip...@chipx86.com
> > > > Review Board -http://www.reviewboard.org
> > > > VMware, Inc. -http://www.vmware.com
> >
> > > > On Thu, May 12, 2011 at 12:16 PM, minkzanity <min...@gmail.com>
> wrote:
> > > > > Here is our wrapper which worked with rbtools-0.2beta1-py2.6.egg,
> and
> > > > > doesn't with 0.3.2
> >
> > > > > import os
> > > > > import sys
> > > > > import time
> >
> > > > > mydir = os.path.dirname(__file__)
> > > > > os.environ['PATH'] += ";"+mydir
> > > > > parentdir = os.path.dirname(mydir)
> > > > > pkgs = os.path.join(parentdir, "Python26", "site-packages")
> > > > > sys.path.append(pkgs)
> > > > > import site
> > > > > site.addsitedir(pkgs)
> >
> > > > > if len(sys.argv)<=1:
> > > > >        changelist = raw_input("perforce changelist number: ")
> > > > >        sys.argv.append(changelist)
> >
> > > > > sys.argv.extend(["--server=http://myreviewboard/";,  "--
> > > > > username=genericuser",
> > > > >                 "--password=genericuser", "--submit-
> > > > > as="+os.environ["USERNAME"].lower()])
> >
> > > > > __requires__ = 'rbtools==0.3.2'
> > > > > import pkg_resources
> > > > > pkg_resources.run_script('rbtools==0.3.2', 'post-review')
> >
> > > > > On May 12, 12:06 pm, Christian Hammond <chip...@chipx86.com>
> wrote:
> > > > > > It doesn't sound as if this is installed correctly. Post-review
> is
> > > > > > actually a Python module with a thin wrapper script. It looks
> like
> > > > > > that thin wrapper is what you have on \\share.
> >
> > > > > > What you can do is install RBTools into a custom PYTHONPATH on
> the
> > > > > > share, and then provide a new, custom wrapper that invokes our
> > > wrapper
> > > > > > with the python path set.
> >
> > > > > > Christian
> >
> > > > > > On Thursday, May 12, 2011, minkzanity <min...@gmail.com> wrote:
> > > > > > > We are using RB 1.5.5 and RBTools 0.3.2 egg.
> >
> > > > > > > We are running into this error:
> >
> > > > > > > Traceback (most recent call last):
> > > > > > >   File "\\share\post-review.py", line 24, in <module>
> > > > > > >     pkg_resources.run_script('rbtools==0.3.2', 'post-review')
> > > > > > >   File "C:\Python26\lib\site-packages\pkg_resources.py", line
> 489,
> > > in
> > > > > > > run_script
> > > > > > >     self.require(requires)[0].run_script(script_name, ns)
> > > > > > >   File "C:\Python26\lib\site-packages\pkg_resources.py", line
> 1201,
> > > in
> > > > > > > run_script
> > > > > > >     raise ResolutionError("No script named %r" % script_name)
> > > > > > > pkg_resources.ResolutionError: No script named 'post-review'
> >
> > > > > > > This script was working when we were using rbtools-0.2beta1.
>  If we
> > > > > > > use egg 0.2beta1, it seems to resolve the script name, but it's
> > > > > > > incompatibale with RB 1.5.5
> >
> > > > > > > Any ideas?
> >
> > > > > > > --
> > > > > > > Want to help the Review Board project? Donate today athttp://
> > > > >www.reviewboard.org/donate/
> > > > > > > Happy user? Let us know athttp://www.reviewboard.org/users/
> > > > > > > -~----------~----~----~----~------~----~------~--~---
> > > > > > > To unsubscribe from this group, send email to
> > > > > reviewboard+unsubscr...@googlegroups.com
> > > > > > > For more options, visit this group athttp://
> > > > > groups.google.com/group/reviewboard?hl=en
> >
> > > > > > --
> > > > > > --
> > > > > > Christian Hammond - chip...@chipx86.com
> > > > > > Review Board -http://www.reviewboard.org
> > > > > > VMware, Inc. -http://www.vmware.com-Hidequoted text -
> >
> > > > > > - Show quoted text -
> >
> > > > > --
> > > > > Want to help the Review Board project? Donate today at
> > > > >http://www.reviewboard.org/donate/
> > > > > Happy user? Let us know athttp://www.reviewboard.org/users/
> > > > > -~----------~----~----~----~------~----~------~--~---
> > > > > To unsubscribe from this group, send email to
> > > > > reviewboard+unsubscr...@googlegroups.com
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/reviewboard?hl=en-Hide quoted text -
> >
> > > > - Show quoted text -
> >
> > > --
> > > Want to help the Review Board project? Donate today at
> > >http://www.reviewboard.org/donate/
> > > Happy user? Let us know athttp://www.reviewboard.org/users/
> > > -~----------~----~----~----~------~----~------~--~---
> > > To unsubscribe from this group, send email to
> > > reviewboard+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/reviewboard?hl=en- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to