Files
Noerr 0dc41c1212 [bindings/python] Deprecate set_source_string; remove it from the Guile bindings
gnc_price_set_source_string maps a source string to the PriceSource enum and
silently leaves the source unchanged for anything it doesn't recognize -- a
silent no-op a naive Python or Guile script can hit. Steer callers to
set_source() with a PriceSource member (added in #2317) instead.

Python bindings:
- Deprecate GncPrice.set_source_string(): it now emits a DeprecationWarning
  pointing at set_source(PriceSource.<...>). It still works during the
  deprecation period and still guards -- if the string is not recognized (the
  round-tripped source no longer equals the input) it raises ValueError rather
  than silently doing nothing.
- Fix the deprecated() decorator in deprecation.py: it referenced the undefined
  DeprecationWarnig and inspect.current_frame(), so it raised instead of
  warning (the one existing @deprecated use was latently broken).

Guile bindings:
- mark gnc-price-set-source-string deprecated in engine.i.
  (Python and Guile use separate SWIG interface files, so Python is
  handled separately). The only in-tree Guile caller is the QIF importer, updated to
  gnc-price-set-source with PRICE-SOURCE-USER-PRICE; the redundant
  set-source-string in test-engine-extras.scm's fixture helper is dropped.

Tests (test_price_and_wrapping.py):
- TestSetSourceStringGuard covers the guard (still raises on an unrecognized
  string) and the new DeprecationWarning.

Removing set_source_string from the Python bindings is a follow-up.
2026-09-25 16:05:19 -07:00
..
2022-03-28 23:02:38 +08:00
2020-12-09 06:39:51 +08:00
2023-07-21 13:57:39 -07:00