Repository: regro/regolith

Issue:
ENH: l_projecta print in a verbose way when -v is specified
related to #480 #481 #482 
Current behavior:
-v is accepted but has no action

Desired behavior:
-v printout looks something like 
```
20mw_grant_lister:
    status: finished, begin_date: 2020-05-28 due_date: 2020-06-23 end_date 2020-06-18 grant: dmref19
    description: Regolith lister for grants
    team: 
        lead: mwinitch
        group_members: aejaz, sstao
        collaborators: dnocera (harvard)
```

Discussion:

Patch:
diff --git a/news/l_projecta_verbose.rst b/news/l_projecta_verbose.rst
new file mode 100644
index 00000000..87da5a60
--- /dev/null
+++ b/news/l_projecta_verbose.rst
@@ -0,0 +1,12 @@
+**Added:** None
+
+**Changed:**
+    * The -v flag in l_projecta now produces a verbose output
+
+**Deprecated:** None
+
+**Removed:** None
+
+**Fixed:** None
+
+**Security:** None
\ No newline at end of file
diff --git a/regolith/helpers/l_projectahelper.py b/regolith/helpers/l_projectahelper.py
index 9425c043..02d138b5 100644
--- a/regolith/helpers/l_projectahelper.py
+++ b/regolith/helpers/l_projectahelper.py
@@ -166,6 +166,29 @@ class ProjectaListerHelper(SoutHelperBase):
                                                                                           collaborators))
             return
 
+        if rc.verbose:
+            for p in projecta:
+                grants = None
+                if p.get('grants'):
+                    if isinstance(p.get('grants'), list):
+                        grants = ' ,'.join(p.get('grants'))
+                    else:
+                        grants = p.get('grants')
+                print(p.get('_id'))
+                print(f"    status: {p.get('status')}, begin_date: {p.get('begin_date')}, due_date: {p.get('due_date')}, end_date: {p.get('end_date')}, grant: {grants}")
+                print(f"    description: {p.get('description')}")
+                print("    team:")
+                print(f"        lead: {p.get('lead')}")
+                grp_members = None
+                if p.get('group_members'):
+                    grp_members = ', '.join(p.get('group_members'))
+                collaborators = None
+                if p.get('collaborators'):
+                    collaborators = ', '.join(p.get('collaborators'))
+                print(f"        group_members: {grp_members}")
+                print(f"        collaborators: {collaborators}")
+            return
+
         if rc.grp_by_lead:
             for p in projecta:
                 if p.get('lead') not in grouped_projecta:


Test patch:
diff --git a/tests/test_helpers.py b/tests/test_helpers.py
index 291b8dd9..2808517f 100644
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -31,14 +31,11 @@ helper_map = [
     (["helper", "l_milestones", "--verbose", "--lead", "lyang"],
      "2021-01-01: lead: lyang, 20ly_newprojectum, status: proposed\n    Type: \n    Title: deliverable\n    log url: \n    Purpose: deliver\n    Audience: beginning grad in chemistry\n2020-05-20: lead: lyang, 20ly_newprojectum, status: proposed\n    Type: meeting\n    Title: Project lead presentation\n    log url: \n    Purpose: to act as an example milestone.  The date is the date it was finished.  delete the field until it is finished.  In this case, the lead will present what they think is the project after their reading. Add more milestones as needed.\n    Audience: lyang, scopatz, ascopatz\n2020-05-06: lead: lyang, 20ly_newprojectum, status: proposed\n    Type: meeting\n    Title: Kick off meeting\n    log url: \n    Purpose: introduce project to the lead\n    Audience: lyang, scopatz, ascopatz\n"
      ),
-    (["helper", "l_projecta", "--verbose"],
-     "20ly_newprojectum\n20sb_firstprojectum\n"
-     ),
     (["helper", "l_projecta", "--verbose", "--lead", "ascopatz"],
-     "20sb_firstprojectum\n"
+     "20sb_firstprojectum\n    status: proposed, begin_date: 2020-04-28, due_date: None, end_date: 2020-06-05, grant: SymPy-1.1\n    description: My first projectum\n    team:\n        lead: ascopatz\n        group_members: ascopatz\n        collaborators: aeinstein, pdirac\n"
      ),
-    (["helper", "l_projecta", "--verbose", "--person", "ascopatz"],
-     "20ly_newprojectum\n20sb_firstprojectum\n"
+     (["helper", "l_projecta", "--verbose", "--person", "ascopatz"],
+     "20ly_newprojectum\n    status: started, begin_date: 2020-04-29, due_date: None, end_date: None, grant: SymPy-1.1\n    description: more work\n    team:\n        lead: lyang\n        group_members: ascopatz\n        collaborators: afriend\n20sb_firstprojectum\n    status: proposed, begin_date: 2020-04-28, due_date: None, end_date: 2020-06-05, grant: SymPy-1.1\n    description: My first projectum\n    team:\n        lead: ascopatz\n        group_members: ascopatz\n        collaborators: aeinstein, pdirac\n"
      ),
     (["helper", "l_projecta", "--grant", "SymPy-1.1"],
      "20ly_newprojectum\n20sb_firstprojectum\n"
@@ -52,6 +49,9 @@ helper_map = [
     (["helper", "l_projecta", "--grp_by_lead", "-l", "ascopatz"],
      "ascopatz:\n    20sb_firstprojectum\n"
      ),
+    (["helper", "l_projecta", "--verbose"],
+     "20ly_newprojectum\n    status: started, begin_date: 2020-04-29, due_date: None, end_date: None, grant: SymPy-1.1\n    description: more work\n    team:\n        lead: lyang\n        group_members: ascopatz\n        collaborators: afriend\n20sb_firstprojectum\n    status: proposed, begin_date: 2020-04-28, due_date: None, end_date: 2020-06-05, grant: SymPy-1.1\n    description: My first projectum\n    team:\n        lead: ascopatz\n        group_members: ascopatz\n        collaborators: aeinstein, pdirac\n"
+     ),
     (["helper", "l_projecta", "--ended", "--date", "2020-06-02"],
      "20sb_firstprojectum    My first projectum\n    Lead: ascopatz    Members: ascopatz    Collaborators: aeinstein, pdirac\n"
      ),
@@ -80,7 +80,7 @@ helper_map = [
      ""
      ),
     (["helper", "u_milestone", "20sb_firstprojectum", "--index", "5",
-      "--status", "converged","--due_date", "2020-06-01"],
+      "--status", "converged", "--due_date", "2020-06-01"],
      "20sb_firstprojectum has been updated in projecta\n"
      ),
     (["helper", "u_milestone", "20sb"],
@@ -146,7 +146,7 @@ helper_map = [
     (["helper", "l_todo", "--id", "sbillinge", "--short_tasks", "65"],
      "1. read paper\n2. prepare the presentation\n"
      ),
-    (["helper", "l_todo", "--verbose", "--id", "sbillinge","--short_tasks"],
+    (["helper", "l_todo", "--verbose", "--id", "sbillinge", "--short_tasks"],
      "1. prepare the presentation\n     --notes: ['about 10 minutes', \"don't forget to upload to the website\"]\n     --due: 2020-07-29, importance:0, 30.0 min, start date: 2020-06-22\n"
      ),
     (["helper", "l_todo", "--id", "sbillinge"],
@@ -196,9 +196,9 @@ helper_map = [
      ),
     (["helper", "u_institution", "columbiau",
       "--aka", "ucolumbia", "Columbia University in the City of New York",
-      "--dept_id", "mathematics", "--dept_name","Department of Mathematics",
+      "--dept_id", "mathematics", "--dept_name", "Department of Mathematics",
       "--dept_aka", "dept. of mathematics", "math department",
-      "--school_id", "cc", "--school_name", "Columbia College","--school_aka", "CC",
+      "--school_id", "cc", "--school_name", "Columbia College", "--school_aka", "CC",
       "--date", "2020-01-01"],
      "columbiau has been updated/added in institutions\n"
      ),