ubiquity-slideshow team mailing list archive
-
ubiquity-slideshow team
-
Mailing list archive
-
Message #01988
[Merge] lp:~lderan/ubiquity-slideshow-ubuntu/test into lp:ubiquity-slideshow-ubuntu
You have been requested to review the proposed merge of lp:~lderan/ubiquity-slideshow-ubuntu/test into lp:ubiquity-slideshow-ubuntu.
For more details, see:
https://code.launchpad.net/~lderan/ubiquity-slideshow-ubuntu/test/+merge/180747
Slideshow.py - now fetches the version number and name and sends them to the slideshow
Slideshow.js - replaces objects with .versionId & .releaseName with Id and name respectively
--
https://code.launchpad.net/~lderan/ubiquity-slideshow-ubuntu/test/+merge/180747
Your team Ubiquity Slideshow is requested to review the proposed merge of lp:~lderan/ubiquity-slideshow-ubuntu/test into lp:ubiquity-slideshow-ubuntu.
=== modified file 'Slideshow.py'
--- Slideshow.py 2012-09-05 20:16:23 +0000
+++ Slideshow.py 2013-08-18 21:13:35 +0000
@@ -4,6 +4,8 @@
from gi.repository import GLib, Gdk, Gtk, WebKit
from configparser import ConfigParser
import subprocess
+import platform
+import csv
import sys
import locale
@@ -36,6 +38,20 @@
if controls:
parameters.append('controls')
+ ''' Fetches the version number from /etc/lsb-release '''
+ version = platform.linux_distribution()[1]
+ ''' now to get the full name as .linux_distribution only returns the shortname '''
+ release = ""
+ distroInfoFile = open("/usr/share/distro-info/ubuntu.csv")
+ csv_reader = csv.DictReader(distroInfoFile)
+ for row in csv_reader:
+ if row['version'] == version:
+ release = row['codename']
+ break
+
+ parameters.append('ver='+version)
+ parameters.append('release='+release)
+
WebKit.WebView.__init__(self)
parameters_encoded = '&'.join(parameters)
self.open('%s#%s' % (slideshow_main, parameters_encoded))
=== modified file 'slideshows/link-core/slideshow.js'
--- slideshows/link-core/slideshow.js 2013-02-13 16:02:10 +0000
+++ slideshows/link-core/slideshow.js 2013-08-18 21:13:35 +0000
@@ -37,7 +37,30 @@
var directory = {};
var extra_directory = {};
+var versionNumber;
+var releaseName;
+
+$.extend({
+ getUrlVars: function(){
+ var vars = [], hash;
+ var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+ for(var i = 0; i < hashes.length; i++)
+ {
+ hash = hashes[i].split('=');
+ vars.push(hash[0]);
+ vars[hash[0]] = hash[1];
+ }
+ return vars;
+ },
+ getUrlVar: function(name){
+ return decodeURIComponent($.getUrlVars()[name]);
+ }
+});
+
$(document).ready(function() {
+ versionNumber = $.getUrlVar('ver');
+ releaseName = $.getUrlVar('release');
+
function loadExtraSlides() {
$.ajax({
type: 'GET',
@@ -212,6 +235,12 @@
success: function(data, status, xhr) {
$(data).appendTo(slide);
translateSlideContents(locale, slide);
+ $(slide).find(".versionId").each(function(){
+ $(this).html(versionNumber);
+ });
+ $(slide).find(".releaseName").each(function(){
+ $(this).html(releaseName);
+ });
}
});
} else {
=== modified file 'slideshows/xubuntu/slides/00_welcome.html'
--- slideshows/xubuntu/slides/00_welcome.html 2013-06-25 15:52:49 +0000
+++ slideshows/xubuntu/slides/00_welcome.html 2013-08-18 21:13:35 +0000
@@ -4,7 +4,7 @@
<div class="main">
<div class="content">
- <p>You have chosen to install the latest version of Xubuntu, 13.10.</p>
+ <p>You have chosen to install the latest version of Xubuntu, <span class="releaseName"></span> <span class="versionId"></span>.</p>
<p>This exciting piece of software is brought to you free of any fees, for your use and any others you want to share it with.</p>
<p>Since you are installing this software using the Xubuntu live installation, feel free to examine things as it installs. After the installation, the desktop will look much the same as it does now.</p>
</div>
References