Skip to content

Commit

Permalink
subtitle (#1167)
Browse files Browse the repository at this point in the history
* add subtitle to exemplars

* subtitle added to presentations

* default is now no repo. adjust tests
  • Loading branch information
sbillinge authored Dec 30, 2024
1 parent e02c25c commit dd61b17
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 6 deletions.
23 changes: 23 additions & 0 deletions news/defaults.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* defaults for adding presentations is no-cal and no-repo. These will be created if selected as --cal and --repo on the command line

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/subtitle.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* subtitle added to schemas and exemplars

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
1 change: 1 addition & 0 deletions src/regolith/exemplars.json
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,7 @@
"project": "18sob_clustermining",
"status": "accepted",
"title": "Graphitic Dephenestration",
"subtitle": "Throwing the baby out with the bathwater",
"type": "award",
"webinar": false
},
Expand Down
10 changes: 4 additions & 6 deletions src/regolith/helpers/a_presentationhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def subparser(subpi):
default="invited",
)
subpi.add_argument("-w", "--webinar", help="Is the presentation a webinar?", action="store_true")
subpi.add_argument("--cal", help="Add the presentation to google calendar", action="store_true")
subpi.add_argument("--repo", help="Create a GitHub/Lab repo for the presentation", action="store_true")
subpi.add_argument(
"--no-expense",
help="Do not add a template expense item to the "
Expand Down Expand Up @@ -119,10 +121,6 @@ def subparser(subpi):
"--id",
help="Override the default id created from the date, " "speaker and place by specifying an id here",
)
subpi.add_argument("--no-cal", help="Do not add the presentation to google calendar", action="store_true")
subpi.add_argument(
"--no-repo", help="Do not create a GitHub/Lab repo for the presentation", action="store_true"
)
return subpi


Expand Down Expand Up @@ -192,7 +190,7 @@ def construct_global_ctx(self):
def db_updater(self):
rc = self.rc

if not rc.no_cal:
if rc.cal:
event = {
"summary": rc.name,
"location": rc.place,
Expand Down Expand Up @@ -289,7 +287,7 @@ def db_updater(self):
rc.client.insert_one(rc.expense_db, EXPENSES_COLL, edoc)
print(f"{key} has been added in {EXPENSES_COLL} in database {rc.expense_db}")

if not rc.no_repo:
if rc.repo:
if not hasattr(rc, "repos"):
rc.repos = []
if not hasattr(rc, "tokens"):
Expand Down
5 changes: 5 additions & 0 deletions src/regolith/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,11 @@
"type": "string",
"eallowed": "PRESENTATION_STATI"
},
"subtitle": {
"description": "subtitle of the presentation",
"required": false,
"type": "string"
},
"title": {
"description": "title of the presentation",
"required": true,
Expand Down
1 change: 1 addition & 0 deletions tests/outputs/a_presentation/presentations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
presentation_url: http://github.com/blob/my_talk.pdf
project: 18sob_clustermining
status: accepted
subtitle: Throwing the baby out with the bathwater
title: Graphitic Dephenestration
type: award
webinar: false
Expand Down
1 change: 1 addition & 0 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,7 @@ def test_helper_python_loose(hm, make_db, capsys):
"http://drive.google.com/SEV356DV",
"--no-cal",
"--force",
"--repo",
], # Expect a new presentation and new expense in db 'test'
"2006na_testc.2 has been added in presentations\n2006na_testc.2 has been added in expenses in database test\nrepo 2006na_testc.2 has been created at https://example.com.\nClone this to your local using (HTTPS):\ngit clone https://example.com:talks/2006na_testc.2.git\nor (SSH):\ngit clone [email protected]:talks/2006na_testc.2.git\n",
),
Expand Down

0 comments on commit dd61b17

Please sign in to comment.