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]

  1. #!/usr/bin/env python
  2.  
  3. import gtk, gtkmozembed, gobject, threading, time, sys
  4.  
  5. class PalaApp():
  6.  
  7. def __init__(self):
  8.  
  9. self.default_padding = 5
  10. self.timeout = 15000
  11.  
  12. # Creo Finestra e WebView
  13. self.Window = gtk.Window(gtk.WINDOW_TOPLEVEL)
  14. self.Window.set_title("Pala ControllaPagina")
  15. self.WebView = gtkmozembed.MozEmbed()
  16.  
  17. # Creo il VBox per organizzarmi tutto
  18. VBox = gtk.VBox()
  19. VBox.pack_end(self.WebView, True, True, self.default_padding)
  20.  
  21. label = gtk.Label("Pagina")
  22. self.UrlField = gtk.Entry()
  23. self.UrlField.connect('activate',
  24. lambda w: self.LoadPage(self.UrlField.get_text()))
  25. self.CheckPageButton = gtk.Button("Controlla pagina")
  26.  
  27. Toolbar = gtk.HBox()
  28. BackButton = gtk.Button("Indietro", gtk.STOCK_GO_BACK)
  29. ForwardButton = gtk.Button("Avanti", gtk.STOCK_GO_FORWARD)
  30. BackButton.connect('clicked', self.ButtonBack_cb)
  31. ForwardButton.connect('clicked', self.ForwardButton_cb)
  32. Toolbar.pack_start(BackButton, False, True, self.default_padding)
  33. Toolbar.pack_start(ForwardButton, False, True, self.default_padding)
  34. Toolbar.pack_start(label, False, True, 2* self.default_padding)
  35. Toolbar.pack_start(self.UrlField, True, True, self.default_padding)
  36. Toolbar.pack_start(self.CheckPageButton, False, False,
  37. self.default_padding)
  38. VBox.pack_end(Toolbar, False, True, self.default_padding)
  39.  
  40. self.Window.add(VBox)
  41. self.Window.resize(740,680)
  42. self.Window.show_all()
  43.  
  44. # Tengo traccia dell'url
  45. self.WebView.connect('open-uri',
  46. lambda w, url: self.UrlField.set_text(url))
  47.  
  48. self.Window.connect('destroy', self.Quit)
  49.  
  50. # Mi segno l'id della connect del PalaUpdater
  51. self.updating = False
  52.  
  53. self.CheckPageButton.connect('clicked', self.CheckPageButton_cb)
  54.  
  55. def GetUrl(self):
  56. return self.WebView.get_location()
  57.  
  58. def ButtonBack_cb(self, w):
  59. if self.WebView.can_go_back():
  60. self.WebView.go_back()
  61.  
  62. def ForwardButton_cb(self, w):
  63. if self.WebView.can_go_forward():
  64. self.WebView.go_forward()
  65.  
  66. def Quit(self, w):
  67. gtk.main_quit()
  68.  
  69. def LoadPage(self, url):
  70. """Carica la pagina data nella webView"""
  71. self.UrlField.set_text(url)
  72. self.WebView.load_url(url)
  73.  
  74. def Reload(self):
  75. # print "eheh %s" % self.updating
  76. # self.LoadPage(self.GetUrl())
  77. print "Faccio il reload"
  78. self.WebView.reload(gtkmozembed.FLAG_RELOADBYPASSCACHE)
  79. if self.updating:
  80. gobject.timeout_add(self.timeout,
  81. self.Reload)
  82.  
  83.  
  84. def CheckPageButton_cb(self, w):
  85. if not self.updating:
  86. self.updating = True
  87. gobject.timeout_add(self.timeout,
  88. self.Reload)
  89. self.CheckPageButton.set_label("Smetti di controllare la pagina")
  90. else:
  91. self.CheckPageButton.set_label("Controlla Pagina")
  92. self.updating = False
  93.  
  94. if __name__ == "__main__":
  95.  
  96. pala = PalaApp()
  97. pala.LoadPage("http://www.dm.unipi.it")
  98.  
  99. gtk.main()