1. Gabriele Lanaro
  2. filesnake


filesnake / NOTES.org

* Notes about this project
** Sending files over network
*** Raw sending through Line
The file sending stuff is not really easy however twisted seems to
have a very good way to handle this, illustrated at this link:
(There's an example)

*** Bittorrent
Another way would be integrate a bittorrent library inside the code, in that way:
 pass the .torrent file
 accept and start the connection
There should be at least one tracker. (maybe one for each client)
Maybe the best library is libtorrent-rasterbar

*** Perspective Broker
**** Producer/Consumer
A perspective broker should be nice for doing that, plus the
Producer/Consumer pattern.
The producer/consumer however are on another port like:

def remote_transfer_file(port,host,key):
    start transfer
**** Pager
using pager is on the same port, though I don't know if the
performances are good.

** Features Planned
- Automatic discovery in LAN through avahi
- easy file transfer, possibly fast
- directory transfer
- stop/pause/resume transfer.
- checking for integrity and if there are some parts not integer, it
  will recover that parts without redownloading all the file.

- recovering transfers after ungraceful shutdown [maybe, it will require something like authentication]

* Packaging
** Linux
.desktop files are installed using desktop files install
icons are installed in usr/share/icons/hicolor... and the db should be updated:
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor in the post_install, post_upgrade and post_remove function.
* Notes about twisted
** Deferreds
inlineCallbacks seems something really nice to use, a good way to
simplify much code (they're actually coroutines)
** Testing
Testing is fundamental:
what I've learned:
1) Don't use sockets
2) To test the server, simulate the client calls
3) To test the client, simulate the server responses

** Events:
an useful event stuff is EventDispatcher (twisted.python.dispatch)

A global event dispatcher for events. I'm used for any events that need to span disparate objects in the client.

I should only be used when one object needs to signal an object that it's not got a direct reference to (unless you really want to pass it through here, in which case I won't mind).
I'm mainly useful for complex GUIs.

Method Summary
  	__init__(self, prefix)
  	autoRegister(self, obj)
  	publishEvent(self, name, *args, **kwargs)
  	registerHandler(self, name, meth)

** Factories
from the finger tutorial:

   The same behavior, but finally we see what usefulness the factory
   has: as something that does not get constructed for every
   connection, it can be in charge of the user database. In
   particular, we won't have to change the protocol if the user
   database back-end changes.


* Notes about pygtkhelpers
reading the source is the only way till the 1.0.