Merge lp://staging/~jcsackett/charm-tools/libify-proof into lp://staging/~charmers/charm-tools/trunk

Proposed by j.c.sackett
Status: Superseded
Proposed branch: lp://staging/~jcsackett/charm-tools/libify-proof
Merge into: lp://staging/~charmers/charm-tools/trunk
Diff against target: 651 lines (+348/-289)
2 files modified
scripts/lib/proof.py (+339/-0)
scripts/proof (+9/-289)
To merge this branch: bzr merge lp://staging/~jcsackett/charm-tools/libify-proof
Reviewer Review Type Date Requested Status
Juan L. Negron (community) Approve
Mark Mims (community) Approve
Review via email: mp+143785@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2013-01-18.

Description of the change

Make charm proof code importable elsewhere

For charmworld we need to be able to run the charm proof code without forking
out to subprocess. To do this, we need a more useable version of the proof
code.

* Added a lib folder within scripts that contains proof.py and __init__.py; in
short, it's a simple module.
* Moved the code in script/proof to script/lib/proof.py
* Broke the code into functions handling CLI argument parsing and actual
linting.
* Updated the set of printed error messages into a globally collect LINT
array. A global is less than ideal in this instance, but doing otherwise would
require further re-architecting of the code, and isn't of high value given
globals are already in play.
* Updated the error methods to simply add to the global LINT var. In places
where crit is called, which expects sys.exit, the run method simply returns,
ending further execution.
* Updated script/proof to import the proof code in lib. It then joins the
returned array and outputs to stdout, per the original script, and exits with
the global EXIT_CODE from lib.proof

https://codereview.appspot.com/7133054/

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

Reviewers: mp+143785_code.launchpad.net,

Message:
Please take a look.

Description:
Make charm proof code importable elsewhere

For charmworld we need to be able to run the charm proof code without
forking
out to subprocess. To do this, we need a more useable version of the
proof
code.

* Added a lib folder within scripts that contains proof.py and
__init__.py; in
short, it's a simple module.
* Moved the code in script/proof to script/lib/proof.py
* Broke the code into functions handling CLI argument parsing and actual
linting.
* Updated the set of printed error messages into a globally collect LINT
array. A global is less than ideal in this instance, but doing otherwise
would
require further re-architecting of the code, and isn't of high value
given
globals are already in play.
* Updated the error methods to simply add to the global LINT var. In
places
where crit is called, which expects sys.exit, the run method simply
returns,
ending further execution.
* Updated script/proof to import the proof code in lib. It then joins
the
returned array and outputs to stdout, per the original script, and exits
with
the global EXIT_CODE from lib.proof

https://code.launchpad.net/~jcsackett/charm-tools/libify-proof/+merge/143785

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/7133054/

Affected files:
   A [revision details]
   A scripts/lib/__init__.py
   A scripts/lib/proof.py
   M scripts/proof

Revision history for this message
Mark Mims (mark-mims) wrote :

looks good... don't stop there! :)

review: Approve
Revision history for this message
Juan L. Negron (negronjl) wrote :

I approve this message :)

Merge away ... This is pretty cool and, to quote Mark ... don't stop there!

Thanks,

Juan

review: Approve
175. By j.c.sackett

Get rid of globals.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches