[PATCH] Make Readme discovery not case sensitive

9 views
Skip to first unread message

Ariana Giroux

unread,
Jun 8, 2020, 10:06:31 PM6/8/20
to klaus...@googlegroups.com, Ariana Giroux
Simply converts all known readme naming conventions and file names
within the tree to lower case on file discovery. This ensures double the
coverage of acceptable readme filenames.

This patch is the result of a discussion over making the known readme
naming conventions extendable by the user on the Klaus mailing list.
[ See https://groups.google.com/forum/#!topic/klaus-users/mXjDxyqbeMQ ]
---
klaus/views.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/klaus/views.py b/klaus/views.py
index 6fafdd1..abb2359 100644
--- a/klaus/views.py
+++ b/klaus/views.py
@@ -235,7 +235,7 @@ class IndexView(TreeViewMixin, BaseRepoView):
def _get_readme(self):
tree = self.context['repo'][self.context['commit'].tree]
for name in README_FILENAMES:
- if name in tree:
+ if name.lower() in [t.lower() for t in tree]:
readme_data = self.context['repo'][tree[name][1]].data
readme_filename = name
return (readme_filename, readme_data)
--
2.17.1

Jonas Haag

unread,
Nov 3, 2020, 4:14:20 PM11/3/20
to klaus...@googlegroups.com
Ariana, I just found this in my email backlog and merged it. Thanks for the patch! Sorry for taking so long to merge this. Jonas
> --
> You received this message because you are subscribed to the Google Groups "klaus-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to klaus-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/klaus-users/20200609020615.15002-1-ariana.giroux%40gmail.com.

Ariana Giroux

unread,
Nov 5, 2020, 1:31:52 PM11/5/20
to klaus...@googlegroups.com
Yay! I'm just happy to stop patching onto master!

Thanks again for the wonderful work!

Reply all
Reply to author
Forward
0 new messages