Compare commits

...
This repository has been archived on 2022-05-13. You can view files and clone it, but cannot push or open issues or pull requests.

1 Commits

Author SHA1 Message Date
contrapunctus b3563e7601 Define timeclock backend class 2022-04-01 21:40:09 +05:30
2 changed files with 37 additions and 0 deletions

View File

@ -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))

View File

@ -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