#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# hylaPEx, an hylafax client written in python
#
# www.unipex.it/hylapex/
#
# License:
# GNU General Public License (GPL)
# For more info see LICENSE.txt and LICENSE-GPL.txt
#
# Copyright (C) 2004-2006 Unipex s.r.l., All Rights Reserved.
# Via Vittorio Veneto 83/A
# 33050 Gonars (UD) - Italy
# phone 0039 0432 931511 - fax 0039 0432 931378
# www.unipex.it - michele.petrazzo@unipex.it
import wx, wx.html
import wx_util, os, sys
def create(parent, values=None, listToDisplay=None):
return frm_licence(parent, values, listToDisplay)
class frm_licence(wx.Frame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, prnt, -1, title='Hylapex - Info and licence')
self.SetBackgroundColour(wx.Colour(225, 225, 225))
nb = wx.Notebook(self, -1)
panel_html = wx.Panel(nb, -1)
html_info = wx.html.HtmlWindow(panel_html, -1 )
html_info.AppendToPage(self.overview)
lbl_descr = wx.StaticText(panel_html, - 1, 'Informations and licence')
lbl_descr.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL, False, 'Arial'))
sizer_html = wx.BoxSizer(wx.VERTICAL)
sizer_html.Add(lbl_descr, 0, wx.ALL, 10)
sizer_html.Add(html_info, 1, wx.ALL | wx.EXPAND, 10)
panel_html.SetSizerAndFit(sizer_html)
panel_readme = wx.Panel(nb, -1)
reame_txt = wx.TextCtrl(panel_readme, -1, style=wx.TE_MULTILINE | wx.TE_READONLY)
reame_txt.SetFont(wx.Font(8,wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL, False, 'Courier'))
readme_path = os.path.join(self.exe_path, "README.txt" )
if os.path.exists(readme_path):
f = open(readme_path)
for line in f.readlines():
reame_txt.AppendText(line)
f.close()
#reame_txt.SetSelection(0,0)
else:
reame_txt.AppendText('I cannot find README.txt.\n\nWhy ?? :)\n\nPlease contact me at michele.petrazzo@unipex.it')
sizer_readme = wx.BoxSizer(wx.VERTICAL)
sizer_readme.Add(reame_txt, 1, wx.EXPAND | wx.ALL, 10)
panel_readme.SetSizerAndFit(sizer_readme)
panel_copyright = wx.Panel(nb, -1)
copyright_txt = wx.TextCtrl(panel_copyright, -1, style=wx.TE_MULTILINE | wx.TE_READONLY)
copyright_txt.SetFont(wx.Font(8,wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL, False, 'Courier'))
copyright_path = os.path.join(self.exe_path, "copyright.txt" )
if os.path.exists(copyright_path):
f = open(copyright_path)
for line in f.readlines():
copyright_txt.AppendText(line)
f.close()
else:
copyright_txt.AppendText('I cannot find copyright.txt.\n\nWhy ?? :)\n\nPlease contact me at michele.petrazzo@unipex.it')
sizer_copyright = wx.BoxSizer(wx.VERTICAL)
sizer_copyright.Add(copyright_txt, 1, wx.EXPAND | wx.ALL, 10)
panel_copyright.SetSizerAndFit(sizer_copyright)
if self.listToDisplay:
panel_displayList = wx.Panel(nb, -1)
displayList_txt = wx.TextCtrl(panel_displayList, -1, style=wx.TE_MULTILINE | wx.TE_READONLY)
displayList_txt.SetFont(wx.Font(8,wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL, False, 'Courier'))
readme_path = os.path.join(self.exe_path, "README.txt" )
for line in self.listToDisplay:
displayList_txt.AppendText(line)
sizer_displayList = wx.BoxSizer(wx.VERTICAL)
sizer_displayList.Add(displayList_txt, 1, wx.EXPAND | wx.ALL, 10)
panel_displayList.SetSizerAndFit(sizer_displayList)
nb.AddPage(panel_readme, ' Readme - Features ')
nb.AddPage(panel_copyright, ' Copyright ')
nb.AddPage(panel_html, ' Thanks to - Italian ')
if self.listToDisplay:
nb.AddPage(panel_displayList, ' Current log list ')
self.SetSize(wx.Size(750,300))
self.Layout()
def __init__(self, parent, values, listToDisplay=None):
if values:
paths = values
exe_p = paths.my_path
else:
exe_p = os.path.split(os.path.abspath(sys.argv[0]) ) [0]
self.listToDisplay = listToDisplay
self.exe_path = exe_p
self.logo_path = os.path.join(exe_p, "logo.jpg" )
self.overview = """<html><body>
<center><img src=%s width="200" height="110" align="top">
<h3><center>
hylapex - <a href="http://www.hylafax.org/">hylafax</a>'s client </h3>
<h3><b>hylapex is a software developed by Unipex srl<br><br>www.unipex.it </b><br><br></h3>
Thanks to:
<ul>
<li> python - <a href="http://www.python.org/" >www.python.org </a> - My preferred language, of course :) </li>
<li> wxPython - <a href="http://www.wxpython.org/" >www.wxpython.org </a> - Graphical library</li>
<li> FreeImage - <a href="http://freeimage.sf.net/" > freeimage.sf.net </a> - Very powerfull image library</li>
<li> ctypes - <a href="http://www.wxpython.org/" >http://starship.python.net/crew/theller/ctypes/ </a> - Library for wrap .dll and .so <br>
in python. I use it for call FreeImage and odbc system libraries </li>
<li> pysqlite - <a href="http://pyslite.sf.net/" >pyslite.sf.net</a> - Internal phonebook</li>
<li> mysql-python - <a href="http://mysql-python.sf.net/" >mysql-python.sf.net</a> - External phonebook</li>
<li> boaConstructor - <a href="http://boa-constructor.sf.net/" >boa-constructor.sf.net</a> - My preferred RAD</li>
<li> twisted - <a href="http://www.twistedmatrix.com/" >www.twistedmatrix.com</a> - Event-driven networking framework </li>
<li> GhostScript - <a href="http://www.cs.wisc.edu/~ghost/" >http://www.cs.wisc.edu/~ghost/</a> - Library / program for<br>
work with postscript files and convert it to tiff</li>
<li> GnuWin32 - <a href="http://gnuwin32.sf.net/" >http://gnuwin32.sf.net/</a> - Program for convert tiff files to pdf</li>
</ul>
<h3><br><br><br><br>
Now let me speak in Italian!<br><br>
hylapex - client fax di <a href="http://www.hylafax.org/">hylafax</a></h3>
<h3><b>hylapex e' un software sviluppato da Unipex srl<br><br>www.unipex.it </b><br><br></h3>
Questo software e' rilasciato secondo la licenza pubblica Open Source GPL.<br>
Il testo integrale in lingua originale lo puoi trovare <a href="http://www.gnu.org/licenses/gpl.txt"> qui </a> (http://www.gnu.org/licenses/gpl.txt).<br>
La traduzione in italiano e' di disponibile <a href="http://www.softwarelibero.it/gnudoc/gpl.it.txt"> qui</a> (http://www.softwarelibero.it/gnudoc/gpl.it.txt).
</center>
</body>
</html>
""" % (self.logo_path)
self._init_ctrls(parent)
class MyApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
self.main = create(None)
self.main.Show()
return True
if __name__ == '__main__':
app = MyApp(0)
app.MainLoop()
|