Define timeclock backend class
This commit is contained in:
parent
c47906f0bf
commit
b3563e7601
|
@ -1875,6 +1875,23 @@ Return value is either a list in the form
|
|||
t))
|
||||
;; replace-last:1 ends here
|
||||
|
||||
;; [[file:chronometrist.org::*backend][backend:1]]
|
||||
(defclass chronometrist-timeclock-backend (chronometrist-file-backend-mixin)
|
||||
((extension :initform "timelog"
|
||||
:accessor chronometrist-backend-ext
|
||||
:custom 'string)))
|
||||
|
||||
(chronometrist-register-backend :timeclock
|
||||
"Store records in the timeclock.el format."
|
||||
(make-instance 'chronometrist-timeclock-backend :path chronometrist-file))
|
||||
;; backend:1 ends here
|
||||
|
||||
;; [[file:chronometrist.org::*to-hash-table][to-hash-table:1]]
|
||||
(cl-defmethod chronometrist-to-hash-table ((backend chronometrist-timeclock-backend))
|
||||
(with-slots (file) backend
|
||||
))
|
||||
;; to-hash-table:1 ends here
|
||||
|
||||
;; [[file:chronometrist.org::*remove-prefix][remove-prefix:1]]
|
||||
(defun chronometrist-remove-prefix (string)
|
||||
(replace-regexp-in-string "^chronometrist-" "" string))
|
||||
|
|
|
@ -2897,6 +2897,26 @@ We apply the same hack as in the [[hack-note-plist-group-insert][insert]] method
|
|||
(cl-defmethod chronometrist-count-records ((backend chronometrist-plist-group-backend)))
|
||||
#+END_SRC
|
||||
|
||||
*** timeclock backend
|
||||
**** backend :class:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defclass chronometrist-timeclock-backend (chronometrist-file-backend-mixin)
|
||||
((extension :initform "timelog"
|
||||
:accessor chronometrist-backend-ext
|
||||
:custom 'string)))
|
||||
|
||||
(chronometrist-register-backend :timeclock
|
||||
"Store records in the timeclock.el format."
|
||||
(make-instance 'chronometrist-timeclock-backend :path chronometrist-file))
|
||||
#+END_SRC
|
||||
|
||||
**** to-hash-table
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(cl-defmethod chronometrist-to-hash-table ((backend chronometrist-timeclock-backend))
|
||||
(with-slots (file) backend
|
||||
))
|
||||
#+END_SRC
|
||||
|
||||
** Migration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: program-migration
|
||||
|
|
Reference in New Issue