About This Journal
Technical concerns tend to find a solution as long as there are good people working on them. And Linux has the very best. - Linus Torvalds
FileZilla Server
pepesmith
I’ve been using FileZilla as FTP client for quite some years now. I was stumbled on that program when I’ve searched an alternative for CuteFTP program before. Aside from using a CVS server as a repository of my code, I have setup also a FTP server to update/store some of my favorite programs.
When my IBM-Lenovo R51 was reformatted due to some virus and hijacker/malware, I decided not to install IIS anymore. I have my Apache already and contented using it. I have to look for some alternatives on FTP server. Luckily there is FileZilla server and it was just introduced lately in the FileZilla. Its good to know also that my favorite client is the number 1 FTP client ranked by the sourceforge community. If you are interested on exploring the program you may browse/download it in this link – http://sourceforge.net/projects/filezilla.
Posted in Miscellaneous |
No Comments »
PyGTK and Py2Exe HowTo
pepesmith
- Overview
This is a simple howto on generating stand-alone executables for pygtk programs using py2exe-0.6.5 & PyGtk 2.10.3. - Initial Installation (Windows OS)
1) Install the latest version of python. You may need to add the install location to your PATH environment variable...
e.g. c:\python24
2) Install the latest version of GTK+ for windows.
3) Install the latest version of pygtk for windows.
4) Install py2exe 0.5.x or later.
You may install the installer of Alberto Ruiz (arc) : http://osl.ulpgc.es/~arc/gnome/pygtk-setup.exe
This is all in one installer though still there is a need for refinement on this.
5) Install the installer NSIS. - Configure py2exe for your project
1) Build a setup.py file.
I'm using this on my project - the pytodolist# setup.py
from distutils.core import setup
import py2exe
import globopts = {
"py2exe": {
"excludes": "pango,atk,gobject",
"dll_excludes": [
"iconv.dll","intl.dll","libatk-1.0-0.dll",
"libgdk_pixbuf-2.0-0.dll","libgdk-win32-2.0-0.dll",
"libglib-2.0-0.dll","libgmodule-2.0-0.dll",
"libgobject-2.0-0.dll","libgthread-2.0-0.dll",
"libgtk-win32-2.0-0.dll","libpango-1.0-0.dll",
"libpangowin32-1.0-0.dll"],
}
}setup(
name = "PyToDoList",
description = "A simple ToDoList Program",
version = "0.61",
windows = [
{"script": "todo.py",
"icon_resources": [(1, "checker1.ico")]
}
],
options=opts,
data_files=[("todo.db"),("jojopix.png"),("checker1.ico")],
) - Build the executable
From a command prompt in your project_name folder, run:
python setup.py py2exe
This should create a dist folder in your project folder. - GTK+ Runtime files
A GTK+ runtime for windows will also need to be installed for the standalone executable. Get that from here.
If you happened to used the installer of Alberto Ruiz (arc). You dont have to install this one. - Compiling the Installer using NSIS.
Usually the file extension of the NSI script is .nsi. For more information on NSIS scripting, there's a tutorial available at sourceforge site. Below is my sample NSIS script:
;--------------------------------
;Include Modern UI!include "MUI.nsh"
;--------------------------------
;General;Name and file
Name "PyToDoList"
OutFile "PyToDoList.exe";Default installation folder
InstallDir "$PROGRAMFILES\PyToDoList"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\PyToDoList" "";--------------------------------
;Interface Settings!define MUI_ABORTWARNING
;--------------------------------
;Pages!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English";--------------------------------
;Installer SectionsSection "Package" SecDummy
SetOutPath "$INSTDIR"
File "..\dist\*.*"
;Store installation folder
WriteRegStr HKCU "Software\PyToDoList" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortCut "$INSTDIR\PyToDoList.lnk" "$INSTDIR\todo.exe"
SetOutPath "$SMPROGRAMS\MegSoft Solutions\"
CopyFiles "$INSTDIR\PyToDoList.lnk" "$SMPROGRAMS\MegSoft Solutions\"
CopyFiles "$INSTDIR\PyToDoList.lnk" "$DESKTOP\"
Delete "$INSTDIR\PyToDoList.lnk"
CreateShortCut "$SMPROGRAMS\GemSoft Solutions\Uninstall.lnk" "$INSTDIR\Uninstall.exe"SectionEnd
Section "GTK+" SecDummy2
SetOutPath "$INSTDIR\"
File "..\..\gtklib\*.dll"SetOutPath "$INSTDIR\etc\fonts\"
File "..\..\gtklib\etc\fonts\*.*"SetOutPath "$INSTDIR\etc\gtk-2.0\"
File "..\..\gtklib\etc\gtk-2.0\*.*"SetOutPath "$INSTDIR\etc\pango\"
File "..\..\gtklib\etc\pango\*.*"SetOutPath "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\"
File "..\..\gtklib\lib\gtk-2.0\2.4.0\loaders\*.*"SetOutPath "$INSTDIR\lib\gtk-2.0\2.4.0\engines\"
File "..\..\gtklib\lib\gtk-2.0\2.4.0\engines\*.*"SetOutPath "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\"
File "..\..\gtklib\lib\gtk-2.0\2.4.0\immodules\*.*"SetOutPath "$INSTDIR\lib\pango\1.4.0\modules\"
File "..\..\gtklib\lib\pango\1.4.0\modules\*.*"SetOutPath "$INSTDIR\share\themes\Default\gtk-2.0\"
File "..\..\gtklib\share\themes\Default\gtk-2.0\*.*"SetOutPath "$INSTDIR\share\themes\MS-Windows\gtk-2.0\"
File "..\..\gtklib\share\themes\MS-Windows\gtk-2.0\*.*"SectionEnd
;--------------------------------
;Descriptions;Language strings
LangString DESC_SecDummy ${LANG_ENGLISH} "Main Package"
LangString DESC_SecDummy2 ${LANG_ENGLISH} "GTK+ Package. To be installed if you dont have pre installed GTK+";Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy2} $(DESC_SecDummy2)
!insertmacro MUI_FUNCTION_DESCRIPTION_END;--------------------------------
;Uninstaller SectionSection "Uninstall"
Delete "$INSTDIR\*.*"
Delete "$DESKTOP\PyToDoList.lnk"
Delete "$SMPROGRAMS\GemSoft Solutions\PyToDoList.lnk"
Delete "$SMPROGRAMS\GemSoft Solutions\Uninstall.lnk"RMDir "$SMPROGRAMS\GemSoft Solutions\"
RMDir /r "$INSTDIR\etc\"
RMDir /r "$INSTDIR\lib\"
RMDir /r "$INSTDIR\share\"RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\PyToDoList"
SectionEnd
There are two options for compiling .nsi file.
- Compile the .nsi file by right clicking it and select the Compile NSIS. The
output exe is the installer of the file. - Issue the command makensis
. This will then generate the output exe file.
- Compile the .nsi file by right clicking it and select the Compile NSIS. The
Posted in Python |
3 Comments »
New SQlite Admin
pepesmith
Earlier I've posted a good sqlite database administrator here. This was posted then on my earlier experimentation with the SQlite database. I've found out later that the license is not compatible with licenses suggested by Free Software Foundation. While browsing with the sourceforge website, I've found an interesting application which has a similar function with the SQlite Database Administrator. The link can be found on this site - http://sourceforge.net/projects/sqlitebrowser/.
On its project description it says:
SQLite Database browser is a light GUI editor for SQLite databases, built on top of QT. The main goal of the project is to allow non-technical users to create, modify and edit SQLite databases using a set of wizards and a spreadsheet-like interface.
Its a very good application and can be extended since the source is posted on its CVS server provided by sourceforge. It is written in C++ and uses the Qt toolkit. Unfortunately I've abandoned my experimentation with the Qt when I was hooked on Gnome-like application which the GTK toolkit is very good in producing some of known apps.
Posted in Miscellaneous |
No Comments »