Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1602 by Jan.Koprowski: post-review is extremly useless as external library
http://code.google.com/p/reviewboard/issues/detail?id=1602

*NOTE: Do not post confidential information in this bug report.*

What version are you running?
git master

What's the URL of the page containing the problem?
post-review script architecture


What is the expected output? What do you see instead?

1.
---
Problem:
-----------------
(the biggest one) When I import postreview in mod_python and some function
from postreview just end by die() function I don't see anything on output

Solution:
-----------------
die should raise exception which should be catch in calling main() block,
print and then sys.exit(1) which have sens only when running as command
line program

2.
---
Problem:
-----------------
Variable "options" in postreview is global, and "only" way to pass
"options" is use command line parameters. This isn't good.

Solution:
-----------------
Some solution is parametrize main() by current options.*

Workaround (example):
-----------------
import rbtools.postreview as rb

class Empty():
    pass

rb.options = Empty()
rb.options.rid = None
rb.options.debug = None
rb.options.username = USERNAME
rb.options.password = PASSOWRD
rb.options.server = SERVER
rb.options.publish = False
rb.options.summary = TITLE
rb.options.bugs_closed = BUGS
rb.options.description = DESCRIPTION
rb.options.submit_as = SUBMIT_AS
rb.options.repository_url = REPOSITORY_URL
rb.options.diff_filename = None
rb.options.ccroot_path = None
rb.options.target_groups = None
rb.options.target_people = REVIEWER
rb.options.branch = None
rb.options.testing_done = None

3.
---
Problem:
-----------------
Run main() with custom tool or home is impossible

Solution:
-----------------
Add main() additional parameters like tool, home or something and make the
logic only for run tool as command line before

Workaround:
-----------------
Some things is could be modified by inject some environment variables as
HOME or APPDATA

What operating system are you using? What browser?
Linux / Unix

Please provide any additional information below.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to