mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[modularise] (gnucash eguile)
This commit is contained in:
parent
381b955ddf
commit
ffbd09089c
@ -22,16 +22,29 @@
|
||||
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
;; 02111-1307 USA
|
||||
|
||||
(define-module (gnucash eguile eguile-html-utilities))
|
||||
|
||||
; using all of these seems like overkill --
|
||||
; not sure which are really required
|
||||
(use-modules (gnucash engine))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash app-utils))
|
||||
(use-modules (gnucash report))
|
||||
|
||||
(use-modules (ice-9 regex)) ; for regular expressions
|
||||
(use-modules (srfi srfi-13)) ; for extra string functions
|
||||
|
||||
(export string-substitute-alist)
|
||||
|
||||
(define-public (string-substitute-alist str sub-alist)
|
||||
(with-output-to-string
|
||||
(lambda ()
|
||||
(string-for-each
|
||||
(lambda (c)
|
||||
(display
|
||||
(or (assv-ref sub-alist c)
|
||||
c)))
|
||||
str))))
|
||||
|
||||
(define (string-repeat s n)
|
||||
;; return a string made of n copies of string s
|
||||
(string-join (make-list n s) ""))
|
||||
|
@ -22,6 +22,8 @@
|
||||
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
;; 02111-1307 USA
|
||||
|
||||
(define-module (gnucash eguile eguile-utilities))
|
||||
|
||||
(use-modules (ice-9 match))
|
||||
; using all of these seems like overkill --
|
||||
; not sure which are really required
|
||||
|
@ -86,18 +86,13 @@
|
||||
(use-modules (ice-9 regex)) ; for regular expressions
|
||||
(use-modules (ice-9 rdelim)) ; for read-line
|
||||
(use-modules (ice-9 local-eval)) ; for the-environment
|
||||
(use-modules (gnucash app-utils)) ; for _
|
||||
(use-modules (gnucash core-utils)); for G_ N_
|
||||
(use-modules (gnucash utilities)) ; for gnc:html-string-sanitize
|
||||
|
||||
(define-public (string-substitute-alist str sub-alist)
|
||||
(with-output-to-string
|
||||
(lambda ()
|
||||
(string-for-each
|
||||
(lambda (c)
|
||||
(display
|
||||
(or (assv-ref sub-alist c)
|
||||
c)))
|
||||
str))))
|
||||
(load-and-reexport (gnucash eguile eguile-utilities)
|
||||
(gnucash eguile eguile-html-utilities))
|
||||
|
||||
(export eguile-file-to-string)
|
||||
|
||||
;; regexps used to find start and end of code segments
|
||||
(define startre (and (defined? 'make-regexp) (make-regexp "<\\?scm(:d)?[[:space:]]")))
|
||||
@ -166,8 +161,3 @@
|
||||
(unless (eof-object? next)
|
||||
(local-eval next local-env)
|
||||
(lp (read))))))))))))
|
||||
|
||||
(export eguile-file-to-string)
|
||||
|
||||
(load-from-path "gnucash/eguile/eguile-utilities")
|
||||
(load-from-path "gnucash/eguile/eguile-html-utilities")
|
||||
|
Loading…
Reference in New Issue
Block a user