Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Commit

Permalink
* Updated Manifest to add zip extensions on some systems, related to #44
Browse files Browse the repository at this point in the history
 and #46;

* Granted 'bin' extension for roms on Atari2600 system;
* Updated basic pip requirement file to fix Django version on 1.8.x for now;
* Fixed Makefile action 'install' to use the right pip requirement file path;
* Added a global page footer containing the manager version, close #45;
* Only display supported extensions for knowed rom systems from manifest, for unknow system ddirs don't filter on file extension, close #40;
* Unmount '/admin/' because it's useless and may give back some ressources;
* Naive fix to avoid throwing exception on bad encoded filename in rom list view, just ignore it and continue. Related to #39;
* Bump to 1.1.3;
  • Loading branch information
sveetch committed Dec 20, 2015
1 parent b6b33d8 commit ed08437
Show file tree
Hide file tree
Showing 21 changed files with 133 additions and 87 deletions.
12 changes: 12 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
History
=======

Version 1.1.3 - 2015/12/19
--------------------------

* Updated Manifest to add zip extensions on some systems, related to #44 and #46;
* Granted ``bin`` extension for roms on Atari2600 system;
* Updated basic pip requirement file to fix Django version on 1.8.x for now;
* Fixed Makefile action ``install`` to use the right pip requirement file path;
* Added a global page footer containing the manager version, close #45;
* Only display supported extensions for knowed rom systems from manifest, for unknow system ddirs don't filter on file extension, close #40;
* Unmount ``/admin/`` because it's useless and may give back some ressources;
* Naive fix to avoid throwing exception on bad encoded filename in rom list view, just ignore it and continue. Related to #39;

Version 1.1.1 - 2015/11/01
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ clean: delpyc

install:
virtualenv --no-site-packages .
bin/pip install -r requirements.txt
bin/pip install -r pip-requirements/basic.txt
bin/python manage.py migrate

install-dev: install
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Before doing anything, ensure the Raspberry can access to the internet else conf

Go where you want to install the manager directory then type the following commands: ::

wget -q -O - https://raw.githubusercontent.com/sveetch/recalbox-manager/master/deployment/install.sh | bash /dev/stdin --release=1.1.1
wget -q -O - https://raw.githubusercontent.com/sveetch/recalbox-manager/master/deployment/install.sh | bash /dev/stdin --release=1.1.3

This will download an install script and automatically execute it to proceed to install.

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Django project to manage a Recalbox from a web interface
"""
__version__ = '1.1.1'
__version__ = '1.1.3'
1 change: 1 addition & 0 deletions compass/scss/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$white: #ffffff;
$black: #000000;
$DarkPastelBlue: #34495e;
$Azure4: #838b8b;

// c. Global
$base-font-size: 14px;
Expand Down
3 changes: 2 additions & 1 deletion compass/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
@import "vendor-libs/dropzone";

@import "components/header";
//@import "components/footer";
@import "components/footer";

#body_content{
@import "components/contents";
}
Expand Down
25 changes: 24 additions & 1 deletion compass/scss/components/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,27 @@
* All stuff for footer
*
*/
footer{}
footer{
margin-top: 2rem;
color: $Azure4;

&>.row > .columns > p{
padding-top: 1rem;
padding-bottom: 1rem;
border-top: 1px solid $Azure4;
}

small{
font-size: 80%;
}

p{
color: inherit;
margin: 0;
line-height: 1.1;

&+p{
margin-top: .5rem;
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recalbox-manager",
"version": "0.9.0",
"version": "1.1.3",
"private": true,
"dependencies": {
"debug": "~2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion pip-requirements/basic.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Basic dependancies, common to every versions and environments
django>=1.8
django>=1.8,<1.9
autobreadcrumbs==1.1
1 change: 1 addition & 0 deletions project/MANIFEST.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<system key="atari2600" name="Atari 2600">
<extensions>
<extension>a26</extension>
<extension>bin</extension>
<extension>zip</extension>
</extensions>
<download_links>
Expand Down
61 changes: 0 additions & 61 deletions project/manager_frontend/utils/manifest.py

This file was deleted.

37 changes: 30 additions & 7 deletions project/manager_frontend/views/roms.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,37 @@ def init_system(self):
# Get the system manifest part if any, else a default dict
self.system_manifest = RECALBOX_MANIFEST.get(self.system_key, default_manifest)

def get_rom_choices(self):
rom_list = []
def get_rom_choices(self, force=False):
"""
Return rom files as a choice list for form
Don't list hided files and directories.
If system is a supported system in manifest, filter files so only
supported rom type is listed, else dont filter on file extension.
for item in os.listdir(self.system_path):
if os.path.isfile(os.path.join(self.system_path, item)) and not item.startswith('.'):
rom_list.append( (item, os.path.getsize(os.path.join(self.system_path, item))) )
Use some internal memory cache to not digg the dir each time, use
force=True to bypass the cache
"""
cache_key = '_get_rom_choices_cache'
if force or not hasattr(self, cache_key):
rom_list = []
system_extensions = ['.{}'.format(k) for k in self.system_manifest.get('extensions', [])]

for item in os.listdir(self.system_path):
try:
if os.path.isfile(os.path.join(self.system_path, item)) and not item.startswith('.'):
if system_extensions and os.path.splitext(item)[-1] not in system_extensions:
continue
rom_list.append( (item, os.path.getsize(os.path.join(self.system_path, item))) )
# Issue #39: Naive fix to avoid throwing exception on bad encoded
# filename, just ignore it and continue.
except UnicodeDecodeError:
continue

setattr(self, cache_key, tuple( sorted(rom_list, key=itemgetter(0)) ))

return tuple( sorted(rom_list, key=itemgetter(0)) )
return getattr(self, cache_key)

def get_context_data(self, **kwargs):
context = super(RomListView, self).get_context_data(**kwargs)
Expand Down Expand Up @@ -107,7 +130,7 @@ def post(self, request, *args, **kwargs):

class RomUploadJsonView(JsonMixin, RomListView):
"""
Inherit from RomListView to be similary but gives only response in JSON
Inherit from RomListView to be similary but only response in JSON
Also the delete form should not really be used here
"""
Expand Down
2 changes: 1 addition & 1 deletion project/manager_frontend/views/systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_system_list(self):
existing_sys = []
available_sys = []

# Get systems allready existing as directories
# Get existing systems as directories
for item in os.listdir(path):
# Only display directories
if os.path.isdir(os.path.join(path, item)) and not item.startswith('.'):
Expand Down
3 changes: 1 addition & 2 deletions project/recalbox_manifest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

def autodiscover():
"""
Dummy loader actually, this should be backward compatible for futur assets
discovery per app
Simple manifest loader
"""
from django.conf import settings
from .parser import RecalboxManifestParser
Expand Down
2 changes: 0 additions & 2 deletions project/recalbox_manifest/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def read(self):
"""
manifest = {}

print "self.filepath:", self.filepath

tree = ET.parse(self.filepath)

root = tree.getroot()
Expand Down
2 changes: 1 addition & 1 deletion project/recalbox_manifest/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"""
Recalbox manifest registry
"""
# Just a dummy dict waiting to be filled
# Just an empty dict waiting to be filled
manifest = {}
5 changes: 3 additions & 2 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
from manager_frontend.utils.manifest import RecalboxManifestParser
#from manager_frontend.utils.manifest import RecalboxManifestParser

gettext = lambda s: s

Expand Down Expand Up @@ -93,6 +93,7 @@
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'project.utils.context_processors.site_metas',
'project.utils.context_processors.manager_version',
'autobreadcrumbs.context_processors.AutoBreadcrumbsContext',
],
},
Expand Down Expand Up @@ -181,7 +182,7 @@
# Path to the Recalbox manifest file (actually shipped into manager project)
RECALBOX_MANIFEST_FILEPATH = os.path.join(PROJECT_DIR, 'MANIFEST.xml')

# Default empty entry for a system unknowed from Manifest
# Default empty entry for unknowed system from Manifest
RECALBOX_SYSTEM_DEFAULT = {
'name': 'Unknow',
'extensions': [],
Expand Down
8 changes: 8 additions & 0 deletions project/templates/skeleton.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@
{% block base_content %}{% endblock %}
</div>{% endblock %}

{% block footer_container %}<footer>
<div class="row larger">
<div class="small-12 columns text-right">{% spaceless %}
<p><small>{{ SITE.name }} v{{ manager_version }}</small></p>
{% endspaceless %}</div>
</div>
</footer>{% endblock %}

{% block page_more_js %}
{% javascript_tag "js/app.min.js" %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
recalbox_manifest.autodiscover()

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
#url(r'^admin/', include(admin.site.urls)),
url(r'^', include('project.manager_frontend.urls', namespace='manager')),
]

Expand Down
11 changes: 9 additions & 2 deletions project/utils/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import socket
import imp, os, socket
from django.conf import settings


def get_host_ipaddress():
"""
Little trick to get all host ip address
Expand Down Expand Up @@ -76,6 +75,14 @@ def get_site_metas(with_static=False, with_media=False, is_secure=False,
return metas


def manager_version(request):
"""
Context processor to add the recalbox-manager version
"""
# Tricky way to know the manager version because its version lives out of project path
root = imp.load_source('__init__', os.path.join(settings.BASE_DIR, '__init__.py'))
return {'manager_version': root.__version__}

def site_metas(request):
"""
Context processor to add the current *Site* metas to the context
Expand Down
35 changes: 34 additions & 1 deletion project/webapp_statics/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -10795,7 +10795,40 @@ html.no-flexbox .flex-grid {
line-height: inherit;
}

/* line 96, ../../../compass/scss/app.scss */
/*
*
* All stuff for footer
*
*/
/* line 6, ../../../compass/scss/components/_footer.scss */
footer {
margin-top: 2rem;
color: #838b8b;
}
/* line 10, ../../../compass/scss/components/_footer.scss */
footer > .row > .columns > p, html.no-flexbox footer > .flex-inline-list > .columns > p,
html.no-flexbox footer > .flex-grid > .columns > p, html.no-flexbox footer > .flex-inline-list > .cell > p,
html.no-flexbox footer > .flex-grid > .cell > p {
padding-top: 1rem;
padding-bottom: 1rem;
border-top: 1px solid #838b8b;
}
/* line 16, ../../../compass/scss/components/_footer.scss */
footer small {
font-size: 80%;
}
/* line 20, ../../../compass/scss/components/_footer.scss */
footer p {
color: inherit;
margin: 0;
line-height: 1.1;
}
/* line 25, ../../../compass/scss/components/_footer.scss */
footer p + p {
margin-top: .5rem;
}

/* line 97, ../../../compass/scss/app.scss */
#body_content {
/*
* Breadcrumbs customize
Expand Down

0 comments on commit ed08437

Please sign in to comment.