aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-07-20 21:02:21 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-07-20 21:02:21 -0700
commit285eddcf04950ecbcf2de9d8b9c54dd0d4afb00c (patch)
tree359e16161aec8262eb76c6aba148d29f131701a5 /python/fatcat
parent0c466a3fb52c69f352453ed0517d417fa7ff7ee1 (diff)
downloadfatcat-285eddcf04950ecbcf2de9d8b9c54dd0d4afb00c.tar.gz
fatcat-285eddcf04950ecbcf2de9d8b9c54dd0d4afb00c.zip
python updates for identifier changes
Diffstat (limited to 'python/fatcat')
-rw-r--r--python/fatcat/importer_common.py9
-rw-r--r--python/fatcat/routes.py16
-rw-r--r--python/fatcat/templates/container_view.html3
-rw-r--r--python/fatcat/templates/creator_view.html3
-rw-r--r--python/fatcat/templates/editor_view.html3
-rw-r--r--python/fatcat/templates/file_view.html3
-rw-r--r--python/fatcat/templates/release_view.html3
-rw-r--r--python/fatcat/templates/work_view.html3
8 files changed, 25 insertions, 18 deletions
diff --git a/python/fatcat/importer_common.py b/python/fatcat/importer_common.py
index 6f867f70..9d495aa7 100644
--- a/python/fatcat/importer_common.py
+++ b/python/fatcat/importer_common.py
@@ -27,19 +27,22 @@ class FatcatImporter:
def process_source(self, source, group_size=100):
"""Creates and auto-accepts editgroup every group_size rows"""
- eg = self.api.create_editgroup(fatcat_client.Editgroup(editor_id=1))
+ eg = self.api.create_editgroup(
+ fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae'))
for i, row in enumerate(source):
self.create_row(row, editgroup_id=eg.id)
if i > 0 and (i % group_size) == 0:
self.api.accept_editgroup(eg)
- eg = self.api.create_editgroup(fatcat_client.Editgroup(editor_id=1))
+ eg = self.api.create_editgroup(
+ fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae'))
if i == 0 or (i % group_size) != 0:
self.api.accept_editgroup(eg.id)
def process_batch(self, source, size=50):
"""Reads and processes in batches (not API-call-per-)"""
for rows in grouper(source, size):
- eg = self.api.create_editgroup(fatcat_client.Editgroup(editor_id=1))
+ eg = self.api.create_editgroup(
+ fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae'))
self.create_batch(rows, eg.id)
self.api.accept_editgroup(eg.id)
diff --git a/python/fatcat/routes.py b/python/fatcat/routes.py
index c92f6493..209a7676 100644
--- a/python/fatcat/routes.py
+++ b/python/fatcat/routes.py
@@ -257,7 +257,7 @@ def editgroup_current():
#eg = api.get_or_create_editgroup()
#return redirect('/editgroup/{}'.format(eg.id))
-@app.route('/editgroup/<int:ident>', methods=['GET'])
+@app.route('/editgroup/<ident>', methods=['GET'])
def editgroup_view(ident):
try:
entity = api.get_editgroup(str(ident))
@@ -266,15 +266,15 @@ def editgroup_view(ident):
abort(ae.status)
return render_template('editgroup_view.html', editgroup=entity)
-@app.route('/editor/<username>', methods=['GET'])
-def editor_view(username):
- entity = api.get_editor(username)
+@app.route('/editor/<ident>', methods=['GET'])
+def editor_view(ident):
+ entity = api.get_editor(ident)
return render_template('editor_view.html', editor=entity)
-@app.route('/editor/<username>/changelog', methods=['GET'])
-def editor_changelog(username):
- editor = api.get_editor(username)
- changelog_entries = api.get_editor_changelog(username)
+@app.route('/editor/<ident>/changelog', methods=['GET'])
+def editor_changelog(ident):
+ editor = api.get_editor(ident)
+ changelog_entries = api.get_editor_changelog(ident)
return render_template('editor_changelog.html', editor=editor,
changelog_entries=changelog_entries)
diff --git a/python/fatcat/templates/container_view.html b/python/fatcat/templates/container_view.html
index e65b65b1..bcdbfc95 100644
--- a/python/fatcat/templates/container_view.html
+++ b/python/fatcat/templates/container_view.html
@@ -89,7 +89,8 @@ Raw Object:
</div><div class="ui segment attached">
<b>Fatcat Bits</b>
-<p>Revision #{{ container.revision }}. State is "{{ container.state }}"
+<p>State is "{{ container.state }}". Revision:
+<br><small><code>{{ container.revision }}</code></small>
<br><a href="https://api.qa.fatcat.wiki/v0/container/{{ container.ident }}">As JSON object via API</a>
</div>
diff --git a/python/fatcat/templates/creator_view.html b/python/fatcat/templates/creator_view.html
index 91c0ee52..3047a909 100644
--- a/python/fatcat/templates/creator_view.html
+++ b/python/fatcat/templates/creator_view.html
@@ -63,7 +63,8 @@ Raw Object:
</div><div class="ui segment attached">
<b>Fatcat Bits</b>
-<p>Revision #{{ creator.revision }}. State is "{{ creator.state }}"
+<p>State is "{{ creator.state }}". Revision:
+<br><small><code>{{ creator.revision }}</code></small>
<br><a href="https://api.qa.fatcat.wiki/v0/creator/{{ creator.ident }}">As JSON object via API</a>
</div>
diff --git a/python/fatcat/templates/editor_view.html b/python/fatcat/templates/editor_view.html
index f58b85b5..c9b61f5d 100644
--- a/python/fatcat/templates/editor_view.html
+++ b/python/fatcat/templates/editor_view.html
@@ -7,7 +7,6 @@
</div>
</h1>
-<p>Is Admin? {{ editor.is_admin }}
-<p><a href="/editor/{{ editor.username }}/changelog">Changelog</a>
+<p><b><a href="/editor/{{ editor.id }}/changelog">View editor's changelog</a></b>
{% endblock %}
diff --git a/python/fatcat/templates/file_view.html b/python/fatcat/templates/file_view.html
index 8ded9ced..54a6c18a 100644
--- a/python/fatcat/templates/file_view.html
+++ b/python/fatcat/templates/file_view.html
@@ -90,7 +90,8 @@ Raw Object:
{% endif %}
<b>Fatcat Bits</b>
-<p>Revision #{{ file.revision }}. State is "{{ file.state }}"
+<p>State is "{{ file.state }}". Revision:
+<br><small><code>{{ file.revision }}</code></small>
<br><a href="https://api.qa.fatcat.wiki/v0/file/{{ file.ident }}">As JSON object via API</a>
</div>
diff --git a/python/fatcat/templates/release_view.html b/python/fatcat/templates/release_view.html
index 22a45e15..b3fe0aa6 100644
--- a/python/fatcat/templates/release_view.html
+++ b/python/fatcat/templates/release_view.html
@@ -223,7 +223,8 @@ This release citing other releases.
</div><div class="ui segment attached">
<b>Fatcat Bits</b>
-<p>Revision #{{ release.revision }}. State is "{{ release.state }}"
+<p>State is "{{ release.state }}". Revision:
+<br><small><code>{{ release.revision }}</code></small>
<br><a href="https://api.qa.fatcat.wiki/v0/release/{{ release.ident }}">As JSON object via API</a>
</div>
diff --git a/python/fatcat/templates/work_view.html b/python/fatcat/templates/work_view.html
index ced19397..afee760e 100644
--- a/python/fatcat/templates/work_view.html
+++ b/python/fatcat/templates/work_view.html
@@ -56,7 +56,8 @@ still reference the same underlying "work".
</div><div class="ui segment attached">
<b>Fatcat Bits</b>
-<p>Revision #{{ work.revision }}. State is "{{ work.state }}"
+<p>State is "{{ work.state }}". Revision:
+<br><small><code>{{ work.revision }}</code></small>
<br><a href="https://api.qa.fatcat.wiki/v0/work/{{ work.ident }}">As JSON object via API</a>
</div>