Merge lp://qastaging/~gesha/linaro-license-protection/remove-fallback into lp://qastaging/~linaro-automation/linaro-license-protection/trunk

Proposed by Georgy Redkozubov
Status: Merged
Merged at revision: 144
Proposed branch: lp://qastaging/~gesha/linaro-license-protection/remove-fallback
Merge into: lp://qastaging/~linaro-automation/linaro-license-protection/trunk
Diff against target: 243 lines (+35/-91)
6 files modified
license_protected_downloads/render_text_files.py (+23/-62)
license_protected_downloads/tests/test_render_text_files.py (+11/-21)
settings.py (+1/-5)
templates/textile_fallbacks/HOWTO_flashfirmware.txt (+0/-1)
templates/textile_fallbacks/HOWTO_getsourceandbuild.txt (+0/-1)
templates/textile_fallbacks/HOWTO_install.txt (+0/-1)
To merge this branch: bzr merge lp://qastaging/~gesha/linaro-license-protection/remove-fallback
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+131152@code.qastaging.launchpad.net

Description of the change

This branch removes fallback support for HOWTOs and adds searching of HOWTOs only in current dir.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

In the call to cls.dirEntries, it is unclear what do arguments represent (especially "False"). Python does have one of my favourite features for readability, which is passing arguments by keywords: please use that.

Where you check

         if len(androidpaths) > 0 and len(ubuntupaths) > 0:

you could add an "else" block and get rid of the "else" block in the if below (and replace "elif" simply with "else"): not a big deal, but will move "corner" cases to one if, and actual handling to another.

In tests, I wonder if subdir argument is still needed at all for make_temp_dir?

review: Needs Fixing
Revision history for this message
Georgy Redkozubov (gesha) wrote :

> In the call to cls.dirEntries, it is unclear what do arguments represent
> (especially "False"). Python does have one of my favourite features for
> readability, which is passing arguments by keywords: please use that.

Not sure is you meant what I did, but anyway fixed.

>
> Where you check
>
> if len(androidpaths) > 0 and len(ubuntupaths) > 0:
>
> you could add an "else" block and get rid of the "else" block in the if below
> (and replace "elif" simply with "else"): not a big deal, but will move
> "corner" cases to one if, and actual handling to another.

Done

>
> In tests, I wonder if subdir argument is still needed at all for
> make_temp_dir?

Thanks for pointing to this, I forget to remove initially.

146. By Georgy Redkozubov

Fixes based on review comments

Revision history for this message
Данило Шеган (danilo) wrote :

Ok, now that it's clear that second parameter to dirEntries is "subdir", I suppose we can get rid of that as well :)

Also, please provide a string explanation of the error condition where we raise MultipleFilesException.

147. By Georgy Redkozubov

Removed recursive search based on review.

Revision history for this message
Данило Шеган (danilo) wrote :

Other than the exception still missing the string passed in, looks good. Thanks for keeping up with my requests :)

review: Approve
148. By Georgy Redkozubov

Added exception explanation.

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