Browse Source

user-defined PIname. fixes #3

George C. Privon 3 years ago
parent
commit
126eb7ed80
3 changed files with 13 additions and 5 deletions
  1. 1 1
      README.md
  2. 5 1
      config.rkt.example
  3. 7 3
      update_proposals.rkt

+ 1 - 1
README.md

@@ -2,7 +2,7 @@
 
 Tools to create and manipulate a sqlite3 database with information on telescope and funding proposals.
 
-Before using, copy `config.rkt.example` to `config.rkt` and edit it with your desired database location.
+Before using, copy `config.rkt.example` to `config.rkt` and edit it with your desired database location and, optionally, your last name.
 Then run `create_database.rkt` to create the sqlite3 file and create the `proposals` table.
 Run `update_database.rkt help` for information on how to add/update entries.
 

+ 5 - 1
config.rkt.example

@@ -1,6 +1,10 @@
 #lang typed/racket/base
 
-(provide dbloc)
+(provide dbloc
+         PIname)
 
 (: dbloc String)
 (define dbloc "/path/to/database")
+
+(: PIname String)
+(define PIname "Lastname")

+ 7 - 3
update_proposals.rkt

@@ -158,11 +158,15 @@
     (print-stats Nprop Npending Nrejected))
 
   ; do statistics for proposals as PI
-  (displayln "\n\tPI'ed Proposals")
-  (let-values ([(Nprop Npending Nrejected) (get-stats conn #:selclause "PI LIKE '%Privon%'")])
+  (displayln (string-append "\n\tPI'ed Proposals (by "
+                            PIname
+                            ")"))
+  (let-values ([(Nprop Npending Nrejected) (get-stats conn #:selclause (string-append "PI LIKE '%"
+                                                                                      PIname
+                                                                                      "%'"))])
     (print-stats Nprop Npending Nrejected))
 
-  )
+)
 
 ; given numbers, format somewhat pretty output of proposal statistics
 (define (print-stats Nprop Npending Nrejected)