Merge lp://staging/~stefanor/ibid/exchange-825217 into lp://staging/ibid

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
Approved revision: 1068
Merged at revision: 1033
Proposed branch: lp://staging/~stefanor/ibid/exchange-825217
Merge into: lp://staging/ibid
Diff against target: 549 lines (+258/-99)
8 files modified
docs/api/ibid.utils.rst (+8/-1)
ibid/plugins/conversions.py (+140/-68)
ibid/test/__init__.py (+26/-8)
ibid/test/plugins/test_conversions.py (+52/-4)
ibid/test/plugins/test_core.py (+6/-11)
ibid/test/plugins/test_url.py (+3/-3)
ibid/test/test_utils.py (+19/-0)
ibid/utils/__init__.py (+4/-4)
To merge this branch: bzr merge lp://staging/~stefanor/ibid/exchange-825217
Reviewer Review Type Date Requested Status
Max Rabkin Approve
Review via email: mp+71367@code.staging.launchpad.net

Commit message

XE.com no longer has a nice helpful country to currency list, so we build our own, based on ISO-4127. This means many heuristics, so we include a reasonable test suite.

To post a comment you must log in.
1033. By Stefano Rivera

Load country_codes in _load_currencies

1034. By Stefano Rivera

Comment data-structures, remove XE.com bracketed place name search heuristics, and return to pre r586 (exchange-343775) heuristics

1035. By Stefano Rivera

Plugin name in cacheable_download location

1036. By Stefano Rivera

Add test suite for resolve_currency (and rename to a public name)

1037. By Stefano Rivera

Filter non-exchangeable currencies

Revision history for this message
Max Rabkin (max-rabkin) wrote :

Some non-currencies are missing (search http://en.wikipedia.org/wiki/ISO_4217 for "funds code" for some more -- the funds codes are in table A.2 of the standard, we may be able to use this instead of hard coding).

You should use trial's tempdir functions instead of hardcoding /tmp.

The tests are networking tesst but it don't check for IBID_NETWORKLESS_TEST.

review: Needs Fixing
1038. By Stefano Rivera

Add ibid.test.TestCase, less full-stack than PluginTestCase

1039. By Stefano Rivera

use ibid.test.TestCase for conversions tests

1040. By Stefano Rivera

Use ibid.test.TestCase instead of unittest.TestCase for plugin tests

1041. By Stefano Rivera

More fund codes

Revision history for this message
Stefano Rivera (stefanor) wrote :

A.2 is of course a .doc file. I've just used it to hard-code some more fund codes.

The fund codes don't exactly hurt, they just cause confusion (and one of them matched euro before the euro currency :P )

I implemented mkdtemp, but throwing away the cache after every test is a bit silly, and seeing as our test.ini contains "cachedir = cache", I thought I'd just leave it using that.

1042. By Stefano Rivera

Missing super()

1043. By Stefano Rivera

Typos

1044. By Stefano Rivera

Add a full-stack CurrencyConversionTest

1045. By Stefano Rivera

Group 'currencies for country' output by country

1046. By Stefano Rivera

Omit 'No universal currency' entries

1047. By Stefano Rivera

Don't assume we have country_currencies for every country_code

1048. By Stefano Rivera

Try to determine the country code through country_codes if the currency does not begin with a country code

1049. By Stefano Rivera

Identify all countries into country_currencies or warn. Detect non_currencies early

1050. By Stefano Rivera

Do exact search before 'in' searches, fill more entries in country_currencies (including Euro contries)

1051. By Stefano Rivera

Strip whitespace from re-ordered names

1052. By Stefano Rivera

Make sure we get countries that primarily use another country's currency in country_currencies

1053. By Stefano Rivera

Snarky comment for same-currency conversions

Revision history for this message
Max Rabkin (max-rabkin) wrote :

<Taejo> tibid: currencies for Saint Helena
<tibid> Taejo: Ascension And Tristan Da Cunha Saint Helena uses Saint Helena Pound (SHP)
<Taejo> tumbleweed: ^^
<Taejo> should be called "Saint Helena, Ascension and Tristan da Cunha"
<Taejo> but your code to invert "foo, the republic of"
<Taejo> also "Taiwan, Province of China"
<Taejo> looking through the list, one solution is to check that it ends with " of" before inverting

review: Needs Fixing
1054. By Stefano Rivera

Tweak country comma-reordering to not reorder compound names.

1055. By Stefano Rivera

Document ibid.utils.get_country_codes

1056. By Stefano Rivera

Tweak country comma-reordering to not reorder compound names. in ibid.utils, add tests.

Revision history for this message
Stefano Rivera (stefanor) wrote :

Found a minutely better solution and added a test case. Also some missing documentation and stuff. Sorry the commits are rather unorganised.

1057. By Stefano Rivera

etree's iter() function is only in 2.7 (even if it makes lound deprecation noises)

1058. By Stefano Rivera

Ag screw it, let's stop rotating country names with commas in them. Too messy

1059. By Stefano Rivera

Country: Currency name

1060. By Stefano Rivera

More test cases for Currency Lookup

1061. By Stefano Rivera

Don't let currencies that don't start with country-codes fall through the gaps

1062. By Stefano Rivera

s/Sint/Saint/ only works if you do it everywhere

1063. By Stefano Rivera

Drop country names, the currency table we are using disambiguates currency names sufficiently

1064. By Stefano Rivera

Don't pre-compile regexes unecessarily

1065. By Stefano Rivera

Merge nested if pair

Revision history for this message
Max Rabkin (max-rabkin) :
review: Approve
1066. By Stefano Rivera

Only do the inexact currency name search if rough

1067. By Stefano Rivera

Add fallthrough test case

1068. By Stefano Rivera

Handle reversed format conversion questions, such as 'convert GBP 1 to ZAR'. Otherwise units will grab them

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

to all changes: