Monthly Archives: January 2007

FileZilla Server

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.

PyGTK and Py2Exe HowTo

    1. Overview
      This is a simple howto on generating stand-alone executables for pygtk programs using py2exe-0.6.5 & PyGtk 2.10.3.
    2. 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.
    3. Configure py2exe for your project
      1) Build a setup.py file.
      I’m using this on my project – the pytodolist
      [python]
      # setup.py
      from distutils.core import setup
      import py2exe
      import glob

      opts = {
      “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”)],
      )
      [/python]

    4. 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.
    5. 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.
    6. 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:

      [actionscript]
      ;——————————–
      ;Include Modern UI

      !include “MUI.nsh”

      ;——————————–
      ;General

      ;Name and file
      Name “PyToDoList”
      OutFile “PyToDoList.exe”

      ;Default installation folder
      InstallDir “$PROGRAMFILESPyToDoList”

      ;Get installation folder from registry if available
      InstallDirRegKey HKCU “SoftwarePyToDoList” “”

      ;——————————–
      ;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 Sections

      Section “Package” SecDummy

      SetOutPath “$INSTDIR”

      File “..dist*.*”

      ;Store installation folder
      WriteRegStr HKCU “SoftwarePyToDoList” “” $INSTDIR

      ;Create uninstaller
      WriteUninstaller “$INSTDIRUninstall.exe”

      CreateShortCut “$INSTDIRPyToDoList.lnk” “$INSTDIRtodo.exe”

      SetOutPath “$SMPROGRAMSMegSoft Solutions”
      CopyFiles “$INSTDIRPyToDoList.lnk” “$SMPROGRAMSMegSoft Solutions”
      CopyFiles “$INSTDIRPyToDoList.lnk” “$DESKTOP”
      Delete “$INSTDIRPyToDoList.lnk”
      CreateShortCut “$SMPROGRAMSGemSoft SolutionsUninstall.lnk” “$INSTDIRUninstall.exe”

      SectionEnd

      Section “GTK+” SecDummy2

      SetOutPath “$INSTDIR”
      File “….gtklib*.dll”

      SetOutPath “$INSTDIRetcfonts”
      File “….gtklibetcfonts*.*”

      SetOutPath “$INSTDIRetcgtk-2.0”
      File “….gtklibetcgtk-2.0*.*”

      SetOutPath “$INSTDIRetcpango”
      File “….gtklibetcpango*.*”

      SetOutPath “$INSTDIRlibgtk-2.02.4.0loaders”
      File “….gtkliblibgtk-2.02.4.0loaders*.*”

      SetOutPath “$INSTDIRlibgtk-2.02.4.0engines”
      File “….gtkliblibgtk-2.02.4.0engines*.*”

      SetOutPath “$INSTDIRlibgtk-2.02.4.0immodules”
      File “….gtkliblibgtk-2.02.4.0immodules*.*”

      SetOutPath “$INSTDIRlibpango1.4.0modules”
      File “….gtkliblibpango1.4.0modules*.*”

      SetOutPath “$INSTDIRsharethemesDefaultgtk-2.0”
      File “….gtklibsharethemesDefaultgtk-2.0*.*”

      SetOutPath “$INSTDIRsharethemesMS-Windowsgtk-2.0”
      File “….gtklibsharethemesMS-Windowsgtk-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 Section

      Section “Uninstall”

      Delete “$INSTDIR*.*”

      Delete “$DESKTOPPyToDoList.lnk”
      Delete “$SMPROGRAMSGemSoft SolutionsPyToDoList.lnk”
      Delete “$SMPROGRAMSGemSoft SolutionsUninstall.lnk”

      RMDir “$SMPROGRAMSGemSoft Solutions”

      RMDir /r “$INSTDIRetc”
      RMDir /r “$INSTDIRlib”
      RMDir /r “$INSTDIRshare”

      RMDir “$INSTDIR”

      DeleteRegKey /ifempty HKCU “SoftwarePyToDoList”

      SectionEnd
      [/actionscript]

      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.

New SQlite Admin

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.