Index: scripts/.modules/script.module.weather/lib/xbmcweather/weather.py =================================================================== --- scripts/.modules/script.module.weather/lib/xbmcweather/weather.py (revision 30763) +++ scripts/.modules/script.module.weather/lib/xbmcweather/weather.py (working copy) @@ -35,6 +35,8 @@ def __init__( self, addon, index, refresh, localize ): # set our Addon class self.Addon = addon + # set addon info + self._set_addon_info() # get weather.com code, used to fetch proper weather info self.location_id = self.Addon.getSetting( "id%s" % ( index, ) ) # if ip based geo location, fetch location @@ -49,9 +51,13 @@ self.localize_text_special = localize.localize_text_special # set base path for source self.base_path = os.path.join( self.Addon.getAddonInfo( "Profile" ), "source", "weather-%s.xml" % self.location_id ) - # set addon info - self._set_addon_info() + def _set_addon_info( self ): + # set addon's logo, id and name + self.WINDOW.setProperty( "Addon.Logo", self.Addon.getAddonInfo( "Icon" ) )# $GROUP[Addon Info] Addon's Icon path + self.WINDOW.setProperty( "Addon.Id", self.Addon.getAddonInfo( "Id" ) )# Addon's Id (useful for customized logo's) + self.WINDOW.setProperty( "Addon.Name", self.Addon.getAddonInfo( "Name" ) )# Addon's name + def _get_geo_location_id( self ): # FIXME: Remove if block and always search for mobile application (eg traveling) maybe have a setting since everytime you change # locations it has to fetch ip, if not mobile leave if block. @@ -65,12 +71,6 @@ # set window property (ip based geo location) self.WINDOW.setProperty( "Location.IP", ip ) - def _set_addon_info( self ): - # set addon's logo, id and name - self.WINDOW.setProperty( "Addon.Logo", self.Addon.getAddonInfo( "Icon" ) )# $GROUP[Addon Info] Addon's Icon path - self.WINDOW.setProperty( "Addon.Id", self.Addon.getAddonInfo( "Id" ) )# Addon's Id (useful for customized logo's) - self.WINDOW.setProperty( "Addon.Name", self.Addon.getAddonInfo( "Name" ) )# Addon's name - def fetch_weather( self ): try: # set success message Index: scripts/.modules/script.module.weather/media/moon/Thumbs.db =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: scripts/.modules/script.module.weather/media/weather/Thumbs.db =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: scripts/autoexec.py =================================================================== --- scripts/autoexec.py (revision 30763) +++ scripts/autoexec.py (working copy) @@ -1,28 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://www.xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -# auto execute scripts when xbmc starts, place this file in xbmchome\scripts\ -# -# note: - do not execute more than one script at a time which asks for user input! - -#import xbmc - -#xbmc.executescript('q:\\scripts\\medusa\\start_medusa.py') - Index: scripts/backupsysteminfo.py =================================================================== --- scripts/backupsysteminfo.py (revision 30763) +++ scripts/backupsysteminfo.py (working copy) @@ -1,24 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -# will create bios & eeprom backup and XBMCSystemInfo to /System/Systeminfo/ -import xbmc -xbmc.executehttpapi("execbuiltin(backupsysteminfo)") - Index: scripts/checkmarkexample.py =================================================================== --- scripts/checkmarkexample.py (revision 30763) +++ scripts/checkmarkexample.py (working copy) @@ -1,61 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -import xbmcgui - -def debug( str ): - xbmc.output( str ) - -class Window( xbmcgui.Window ): - def __init__( self ): - xbmcgui.Window.__init__( self ) - self.checkMark = None - - def create( self ): - self.checkMark = xbmcgui.ControlCheckMark( - x=50, y=200, - width=200, height=20, - label="This is my new check mark", - checkWidth=30, checkHeight=30, - alignment=0 ) - self.addControl( self.checkMark ) - self.setFocus( self.checkMark ) - - def onAction( self, action ): - debug( "> Window.onAction( action=[%s] )"%action ) - if action in (9,10): - self.close() - debug( "< Window.onAction( action=[%s] )"%action ) - - def onControl( self, control ): - debug( "> Window.onControl( control=[%s] )"%control ) - if control == self.checkMark: - b = self.checkMark.getSelected() - if b: - xbmcgui.Dialog().ok( "info", "check mark is selected" ) - else: - xbmcgui.Dialog().ok( "info", "check mark is NOT selected" ) - debug( "< Window.onControl( control=[%s] )"%control ) - -win = Window() -win.create() -win.doModal() -del win - Index: scripts/customdialog.py =================================================================== --- scripts/customdialog.py (revision 30763) +++ scripts/customdialog.py (working copy) @@ -1,113 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://www.xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -import xbmcgui - -# get actioncodes from keymap.xml, if you leave these away and still use something like -# ACTION_PREVIOUS_MENU, python wil use it as if it was 0 - -ACTION_MOVE_LEFT = 1 -ACTION_MOVE_RIGHT = 2 -ACTION_MOVE_UP = 3 -ACTION_MOVE_DOWN = 4 -ACTION_PAGE_UP = 5 -ACTION_PAGE_DOWN = 6 -ACTION_SELECT_ITEM = 7 -ACTION_HIGHLIGHT_ITEM = 8 -ACTION_PARENT_DIR = 9 -ACTION_PREVIOUS_MENU = 10 -ACTION_SHOW_INFO = 11 - -ACTION_PAUSE = 12 -ACTION_STOP = 13 -ACTION_NEXT_ITEM = 14 -ACTION_PREV_ITEM = 15 - -# NewDialog class with xbmcgui.WindowDialog as it's base class -# note xbmcgui.WindowDialog has xbmcgui.Window as it's baseclass so we can use this -# dialog the same as a window - -class NewDialog(xbmcgui.WindowDialog): - def __init__(self): - - # create result variable and add some images + buttons to our dialog - self.result = 0 - self.addControl(xbmcgui.ControlImage(177,225,406,140, 'dialog-popup.png')) - - self.buttonOK = xbmcgui.ControlButton(290, 330, 80, 32, 'OK') - self.buttonCancel = xbmcgui.ControlButton(380, 330, 80, 32, 'Cancel') - self.addControl(self.buttonOK) - self.addControl(self.buttonCancel) - - # setting up navigation and focus - self.setFocus(self.buttonOK) - self.buttonOK.controlRight(self.buttonCancel) - self.buttonOK.controlLeft(self.buttonCancel) - self.buttonCancel.controlRight(self.buttonOK) - self.buttonCancel.controlLeft(self.buttonOK) - - # labels - self.lblHeading = xbmcgui.ControlLabel(190, 226, 200, 20, '') - - self.lblLine = [] - self.lblLine.append(xbmcgui.ControlLabel(190, 260, 200, 20, '')) - self.lblLine.append(xbmcgui.ControlLabel(190, 280, 200, 20, '')) - self.lblLine.append(xbmcgui.ControlLabel(190, 300, 200, 20, '')) - self.addControl(self.lblHeading) - self.addControl(self.lblLine[0]) - self.addControl(self.lblLine[1]) - self.addControl(self.lblLine[2]) - - def setHeading(self, text): - self.lblHeading.setLabel(text) - - def setLine(self, line, text): - self.lblLine[line].setLabel(text) - - def onAction(self, action): - if action == ACTION_PREVIOUS_MENU: - # previous menu action recieved, set result to 0 (cancel / aborted) and close the window - self.result = 0 - self.close() - - def onControl(self, control): - if control == self.buttonOK: - # ok butten pressed, set result to 1 and close the dialog - self.result = 1 - self.close() - elif control == self.buttonCancel: - # ok butten pressed, set result to 0 and close the dialog - self.result = 0 - self.close() - - def ask(self): - # show this dialog and wait until it's closed - self.doModal() - return self.result - -dialog = NewDialog() -dialog.setHeading('Python OK / Cancel Dialog') -dialog.setLine(0, 'line 0') -dialog.setLine(1, 'line 1') -dialog.setLine(2, 'line 2') - -print(dialog.ask()) -# print('dialog returned' + str(dialog.ask()) - Index: scripts/dialogbrowse.py =================================================================== --- scripts/dialogbrowse.py (revision 30763) +++ scripts/dialogbrowse.py (working copy) @@ -1,48 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -import xbmcgui - -""" -Usage Explained - -xbmcgui.Dialog().browse(type,prompt,shares) -type can be - 0 for directory - 1 for files - 2 for images (eg it will show thumbnails if skin shows it) - any other number will do directories - -prompt can be text/string - -shares can be -- files -- videos -- music -- programs -- pictures -""" - -print xbmcgui.Dialog().browse(0,"a Directory","files") -print xbmcgui.Dialog().browse(1,"a file","files") -print xbmcgui.Dialog().browse(1,"a music file","music") -print xbmcgui.Dialog().browse(1,"a image","files") - - Index: scripts/dialognumeric.py =================================================================== --- scripts/dialognumeric.py (revision 30763) +++ scripts/dialognumeric.py (working copy) @@ -1,34 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://www.xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -import xbmcgui - -""" -Usage Explained - - -xbmcgui.Dialog().numeric(type,heading) - -""" - -print xbmcgui.Dialog().numeric(0,"Enter a Number") -print xbmcgui.Dialog().numeric(1,"Enter a Date") -print xbmcgui.Dialog().numeric(2,"Enter a Time") -print xbmcgui.Dialog().numeric(3,"Enter a Ip") Index: scripts/dialogselect.py =================================================================== --- scripts/dialogselect.py (revision 30763) +++ scripts/dialogselect.py (working copy) @@ -1,35 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -import xbmc, xbmcgui - -dialog = xbmcgui.Dialog() - -list = ['yes','no','cancel','movies','f:\\music\\test','test','67','true'] -list.append('last item') -selected = dialog.select('select an item', list) -dialog.ok('user selected', 'item nr : ' + str(selected), list[selected]) - -selected = dialog.select('select an action', ['Cancel', 'Reboot', 'Shut Down']) - -if selected == 1: - xbmc.restart() -elif selected == 2: - xbmc.shutdown() Index: scripts/dialogyesno.py =================================================================== --- scripts/dialogyesno.py (revision 30763) +++ scripts/dialogyesno.py (working copy) @@ -1,30 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -import xbmc, xbmcgui - -dialog = xbmcgui.Dialog() -selected = dialog.yesno("header", "doit", "line2", "line3") - -dialog.ok("error", "user selected" + str(selected)) - -if dialog.yesno("restart", "sure?"): - xbmc.restart() - Index: scripts/download apleasure_zip.py =================================================================== --- scripts/download apleasure_zip.py (revision 30763) +++ scripts/download apleasure_zip.py (working copy) @@ -1,63 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -# ftp download script for xbmc - -adres = 'ftp.planet.nl' -remotedir = 'planet/games/quake/maps' -remotefile = 'apleasure.zip' -localfile = 'Q:\\apleasure1.zip' - -import sys, socket, xbmc, xbmcgui -from ftplib import FTP - -class writer: - def __init__(self): - self.size = 0 - self.copied = 0; - def write(self, data): - f.write(data) - self.copied = self.copied + len(data) - dialog.update((self.copied * 100)/ self.size) - -pwriter = writer() - -dialog = xbmcgui.DialogProgress() - -dialog.create("connecting",adres) -ftp = FTP(adres) # connect to host, default port - -dialog.close() -dialog.create("logging in","username = anonymous") -ftp.login() # default, i.e.: user anonymous, passwd user@hostname - -dialog.close() -dialog.create("changing directory to", remotedir) -ftp.cwd(remotedir) -pwriter.size = ftp.size(remotefile) -f = open(localfile, "wb") - -dialog.close() -dialog.create("downloading", remotefile) -ftp.retrbinary('RETR ' + remotefile, pwriter.write, 8192) - -f.close() -dialog.close() -ftp.quit() Index: scripts/GUI Builder.zip =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: scripts/guibuilder.py =================================================================== --- scripts/guibuilder.py (revision 30763) +++ scripts/guibuilder.py (working copy) @@ -1,670 +0,0 @@ -# -# Copyright (C) 2005-2008 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -# - -''' -This module creates your scripts GUI from a standard XBMC skinfile.xml. It works for both Windows and -WindowDialogs. Hopefully it will make it easier to skin your scripts for different XBMC skins. - -There is one optional tag you may use, . This tag is used in place of the folder structure XBMC -skinning engine uses. It's used for setCoordinateResolution(). It is suggested you use the tag. - can be one of (1080i, 720p, 480p, 480p16x9, ntsc, ntsc16x9, pal, pal16x9, pal60, pal6016x9) -e.g. pal - -GUI Builder sets initial focus to the with equal to . - -You may use tags and references.xml will be used for default values if no tag is given. -(Unless you use fastMethod=True) All unsupported tags will be ignored. (e.g. ) - -GUI Builder sets up navigation based on the , , and tags. - -The fadelabel takes multiple