Skip to content

Commit

Permalink
update site
Browse files Browse the repository at this point in the history
  • Loading branch information
nate-parrott committed Mar 1, 2015
1 parent 3c16fc0 commit 06bc665
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
1 change: 0 additions & 1 deletion PluginDirectories/1/hoogle.bundle/1.version

This file was deleted.

1 change: 1 addition & 0 deletions PluginDirectories/1/hoogle.bundle/2.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
909cfef8c012ec8ad93f7088536e25aab2b698789da2d7d77da5b8c78365167b
2 changes: 1 addition & 1 deletion PluginDirectories/1/hoogle.bundle/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Hoogle Search",
"description": "Search Haskell API",
"examples": ["hoogle map", "hoogle (a -> b) -> [a] -> [b]"],
"categories": ["Search", "Developper"],
"categories": ["Search", "Developer"],
"creator_name": "hekt",
"creator_url": "http://www.hekt.org/"
}
2 changes: 1 addition & 1 deletion PluginDirectories/1/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@
{
"categories": [
"Search",
"Developper"
"Developer"
],
"creator_name": "hekt",
"creator_url": "http://www.hekt.org/",
Expand Down
3 changes: 2 additions & 1 deletion PluginDirectories/1/thing.bundle/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "thing",
"displayName": "Thingiverse",
"description": "Search Thingiverse for 3D printable models",
"examples": ["thing extruder upgrade", "t wall plate customizer"]
"examples": ["thing extruder upgrade", "t wall plate customizer"],
"categories": ["Search"]
}
3 changes: 1 addition & 2 deletions PluginDirectories/1/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def get_plugin_name(data):
name = get_plugin_name(data)
print "Uploading plugin:", name

host = 'flashlightplugins.appspot.com'
# host = 'localhost:24080'
host = 'localhost:24080' if '--local' in sys.argv else 'flashlightplugins.appspot.com'

info = requests.get('http://{0}/console_upload/{1}'.format(host, name.encode('utf-8'))).json()
print info['version']
Expand Down
6 changes: 3 additions & 3 deletions flashlightplugins/directory.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ <h4>
<div class='control'>
{% if browse %}
{% if deep_links %}
<a class='install' href='flashlight://plugin/{{ plugin.name }}'>Show <span class='download_count'>{{plugin.model.downloads}}</span></a>
<a class='install' href='flashlight://plugin/{{ plugin.name }}'>Show <span class='download_count'>{{plugin.model.downloads | format_as_compact_download_count}}</span></a>
{% else %}
<a class='install' href='/plugin/{{ plugin.name }}'>View <span class='download_count'>{{plugin.model.downloads}}</span></a>
<a class='install' href='/plugin/{{ plugin.name }}'>View <span class='download_count'>{{plugin.model.downloads | format_as_compact_download_count}}</span></a>
{% endif %}
{% else %}
<a class='install' href='{{ plugin.install_url }}'>Install <span class='download_count'>{{plugin.model.downloads}}</span></a>
<a class='install' href='{{ plugin.install_url }}'>Install <span class='download_count'>{{plugin.model.downloads | format_as_compact_download_count}}</span></a>
{% endif %}
<a class='installing'>Installing...</a>
<a class='uninstall' href='uninstall://{{ plugin.name }}'>Uninstall</a>
Expand Down
8 changes: 7 additions & 1 deletion flashlightplugins/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
extensions=['jinja2.ext.autoescape'],
autoescape=True)

def format_as_compact_download_count(count):
if count > 9000:
return "{:.1f}k".format(count/1000.0)
else:
return str(count)

JINJA_ENVIRONMENT.filters['format_as_compact_download_count'] = format_as_compact_download_count

def template(name, vars={}):
template = JINJA_ENVIRONMENT.get_template(name)
Expand All @@ -34,7 +41,6 @@ def language_suffixes(languages):
break
yield ''


def get_localized_key(dict, name, languages, default=None):
for suffix in language_suffixes(languages):
key = name + suffix
Expand Down

0 comments on commit 06bc665

Please sign in to comment.