viewgit/index.php:465 Only variables should be passed by reference [2048]
viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of RaiTV # # RaiTV 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 of the License, or # (at your option) any later version. # # RaiTV 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 RaiTV; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # # Questo file contiene la classe Loader, che permette di caricare file # esterni senza preoccuparsi di dove si trovano (a grandi linee). E' messa # qui di modo che non ci si debba preoccupare di cercarla, altrimenti # perderebbe tutta la sua utilità :) # __author__ = "Leonardo Robol <leo@robol.it>" import os, sys class Loader(): def __init__(self): """Scopre in che directory è l'eseguibile e ne deduce in che directory dovrebbero trovarsi i vari oggetti utili""" # Determino la cartella di lavoro self.pwd = os.getcwd() # e quella in cui sta il programma principale self.bin = os.path.abspath(sys.argv[0]) self.bin = os.path.dirname(self.bin) # Se questa è una cartella locale, allora # cercheremo i file in locale, altrimenti # nei luoghi atti allo scopo. # Per determinarlo proviamo a cercare le directory che # servono os.chdir(self.bin) try: os.stat("ui") os.stat("RaiTV") self.local = True except OSError: self.local = False ## A questo punto dobbiamo determinare dove sono i moduli ## e file dell'interfaccia ## TODO: Farlo per davvero. def UIPath(self, filename): """Ritorna il path di un file relativo all'interfaccia""" if self.local: return os.path.join(self.bin , "ui", filename) def ModulePath(self): """Ritorna il path da cui importare i moduli""" if self.local: return os.path.join(self.bin, "RaiTV") # # Questo è il programma vero, che viene eseguito quando # questo file viene eseguito direttamente # if __name__ == "__main__": import gtk, pygtk ## Creiamo l'oggetto Loader che si occuperà di ## determinare la posizione dei file interessanti loader = Loader() sys.path.insert(0, loader.ModulePath()) ## Passiamo ad importare ciò che ci serve. from RaiTV import Interface ## Passiamo all'interfaccia anche il loader di ## modo che non si faccia troppi problemi ## a caricare i suoi file ui = Interface.UI(loader) ## Mostriamo tutto ui.show_all() ## Partiti :) gtk.main()