Python environment for D-Rats development

========================================
DEVELOPMENT ENVIROMENT INSTALLATION
========================================
LINUX INSTALL

Note: the source code of d-rats is quite dated, so use python 2.7

Common libraries
 - gtk http://www.gtk.org/download/
 - gtk glade module
 - gobject

 - apt-get install:
    - python-gtk2
    - python-glade2
    - python-serial
    - python-libxml2
    - python-libxslt1

 - easy_install:
    - simplejson
    - feedparser
    - libxml2

These are additional libraries which I have added the new webserver function to show positions on googlemap
    - flask
    - gevent: http://www.gevent.org/
    - gevent-socketio: easy_install gevent-socketio
    - greenlet

========================================
Ms-Windows 7 installation

Note: the source code of d-rats is quite dated, so use python 2.7 compiled 32 bit and 32 bit libraries
(i did a try installing the 64 bit version of python, but wasn't able to find all the libraries needed at 64 bit)


INSTALL PYTHON

 - Get PyTHON: Python 2.7.X 32 bit:
    http://www.python.it/download/
  
 - get GTK:
    - pygtk-all-in-one-2.24.0.win32-py2.7.msi from http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/
 
 - get libXML2 from this page http://users.skynet.be/sbi/libxml-python/
    http://users.skynet.be/sbi/libxml-python/binaries/libxml2-python-2.7.7.win32-py2.7.exe
# Copyright 2015 Maurizio Andreotti  <iz2lxi@yahoo.it>
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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


ASPELL
install aspell from http://aspell.net/win32/:

http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe

install aspell dictionaries (at least english) http://ftp.gnu.org/gnu/aspell/w32/Aspell-en-0.50-2-3.exe

NOTE: in order to install the right dll for spell-checking refer to: http://www.d-rats.com/documentation/4-howtos/34-installing-spelling-support/


PYWIN
http://sourceforge.net/projects/pywin32/files/pywin32/

INSTALL LIBRARIES
download source code of:
  - simplejson https://pypi.python.org/pypi/simplejson/
  - feedparser https://pypi.python.org/pypi/feedparser
  - libxml  http://users.skynet.be/sbi/libxml-python/
  - serial
  at command prompt:
c:>easy_install <source code file>.tar.gz


PY2EXE
- py2exe (required by setup.py): http://www.py2exe.org/

SERIAL
- https://pypi.python.org/pypi/pyserial

Common libraries
 - gtk http://www.gtk.org/download/win32.php
 - gtk glade module: http://sourceforge.net/projects/gladewin32/
 - gobject

========================================
SETTING THE PATH VARIABLE ON MS-WINDOWS

It seems that nasty things happen if you do not have the right order in the path variable… especially if you install local Python and the various libraries, you will easily end up in with a malfunctioning system


Typical User variable path:
C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon

Typical System variable path:
C:\Windows\system32;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;
C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;
C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Microsoft\Web Platform Installer;
C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Common Files;C:\Python27;C:\Python27\Scripts;c:\gtk\bin


========================================
READING / EDITING THE D-RATS APPLICATION

All the files of the source code are text files, so just use an editor able to modify it (notepad as basic)


========================================
EXECUTE THE D-RATS APPLICATION

To execute the d-rats application

- Open a prompt / command line (cmd on widows)
    C:>
- Move to the folder where you have placed the source code
    C:> cd d-rats-3.3.4
- Execute the d-rats application

   D-Rats: “python  d-rats.py”
   D-Rats_repeater: “python  d-rats_repeater.py”
   Map downloader: “python  d-rats_mapdownloader.py”
     
========================================
D-RATS CONFIGURATION AND LOG FILES

the D-Rats stores its configuration in the user home folder
 - on linux this is here:
     /home/users/ [USERNAME] / ...

 - on windows this is here:
    C:\Users\ [USERNAME] \AppData\Roaming\D-RATS

========================================
ERRORS IN FILES TAB

if you happen to see "strange" files appearing into the files tabs, together with un-working d-rats,
then this is most probably happening because of a bad order in the PATH variable of your windows pc.

i.e. have you put the aspell path at the beginning of the PATH instead of at its end?

========================================
INTERNATIONALIZATION - LABEL TRANSLATIONS
the labels dictionaries are translated using the gettext module using the dictionaties located into the
"locales".

the dictionaries are compiled in ".mo" but can be reversed to ".po" to be edited (e.g. with tool ("poedit"):

With installed poedit you can use:

START -> RUN (cmd)

/program files/poedit/bin/msgunfmt ab_AB.mo > ab_AB.po