Luke Ross

Colorado

4 releases git clone https://lukeross.name/projects/colorado.git/

Web-based git repository viewer.

Commit 2a5e4edae2a83e838566ed4edb79885462725e59

partial redo of stuff that got reverted in the big feed remove

Committed 11 Sep 2019 by Luke Ross

colorado/views.py

@@ -51,15 +51,15 @@ def run_on_meld(tpl, id, fn):
 
 
 def configure_template(tpl, repo=None):
-	run_on_meld(
-		tpl,
-		"static-css",
-		lambda n: n.set(
-			"href",
-			current_app.config.get('COLORADO_CSS', None) or
-			url_for(".static", filename="colorado.css")
-		)
-	)
+	css = [
+		c for c in (
+			url_for(".static", filename="colorado.css"),
+			current_app.config.get('COLORADO_CSS', None)
+		) if c
+	]
+	for ele, fn in tpl.findmeld("static-css").repeat(css):
+		ele.set("href", fn)
+
 	run_on_meld(tpl, "static-js", lambda n: n.set("src", url_for(
 		".static", filename="colorado.js"
 	)))
@@ -350,7 +350,10 @@ def history_view(slug, type, id):
 	configure_template(tpl, repo)
 	all_commits = chain([commit], commit.iter_parents())
 	for ele, c in tpl.findmeld("rev").repeat(all_commits):
-		for inner, (thing, type) in ele.findmeld("rev-tag-repeat").repeat(tag_things.get(c.hexsha, [])):
+		repeats = ele.findmeld("rev-tag-repeat").repeat(
+			tag_things.get(c.hexsha, [])
+		)
+		for inner, (thing, type) in repeats:
 			inner.findmeld("rev-tag-link").content(thing.name)
 			inner.findmeld("rev-tag-link").set("href", url_for(
 				".top_level_view", slug=slug, type=type, id=thing.name
@@ -668,8 +671,3 @@ def trees_view(slug):
 			make_tar_filename(slug, type.lower(), thing.name, thing.commit)
 		)
 	return write_template(tpl)
-
-
-@bp.route("/<slug>/feed", methods=["GET"])
-def feed_view(slug):
-	pass


setup.py

@@ -4,14 +4,13 @@ from setuptools import setup
 
 setup(
 	name="Colorado",
-	version="0.7",
+	version="0.8",
 	description="Colorado git browser",
 	author="Luke Ross",
 	author_email="luke@lukeross.name",
 	url="https://lukeross.name/",
 	install_requires=[
 		"arrow",
-                "activitystreams_lxml",
 		"chardet",
 		"flask",
 		"flask-sqlalchemy",