Coder Social home page Coder Social logo

gnutella-simulator's Introduction

=======================
Installation
=======================

* First, you need to have python-setuptools, you can get
it on Ubuntu by using following command
> sudo apt-get install python-setuptools

* For one-time user or developers for staging environment, 
we suggests you should use the following commands at 
root of project directory:

To install, this command would create symlink to project directory
for python to know
> sudo python setup.py develop 

To uninstall i.e. remove the symlink
> sudo python setup.py develop --uninstall

* For pernament user, this is experimental. Do not try this
out unless you understand python setuptools.

To install, this would build and install the package into 
/usr/local/lib/python2.X/dist-packages/ (assuming -nix platform)
> sudo python setup.py install

To uninstall, python setuptools is pretty bad at this. You need
to remove the directory pygnutella-X.X-py2.X.egg from
/usr/local/lib/python2.X/dist-packages/ manually.

* After you install successfully by one of two ways above, now you can
try our example code of our framework. Look to next section Demo for
that

=======================
Demo
=======================

Inside "examples" directory, each python script is a separate example.
If the example is large, it puts into a directory of its own include
with is own README for running it.

Each example is designed to demo a part of framework i.e. showing
how to use the framework. Once you successfully installed
the package, you can run the example with ease in a terminal.

For example, you can run simple_cache_example.py:
> cd examples
> python simple_cache_example.py

To further you understanding of pygnutella framework, please
look at next section Framework Design.

=======================
Framework Design
=======================

Please look into report.pdf that comes with this.

=======================
Coding Standard
=======================

+ indentation is 4 spaces not 2 spaces (and also not a tab). Configure your
editor to do so.
+ your class is in directory pygnutella (aka package pygnutella)
+ test script is in directory tests
+ class name: class name capitalise every word
+ method name and variable name: lower case and underscore between every word
+ use one logger from Servent
     
+ use doc string three quote """ """ for every class or function you feel the
name is too ambiguous
+ use # for comment

=======================
How to make and run unit test
=======================

1. Install nose using setuptools/distribute:

> easy_install nose
OR
> pip install nose

Or, if you don’t have setuptools/distribute installed, cd to the source
package(nose-1.1.2), and:

> python setup.py install
OR
> sudo python setup.py install

2. Run the test:
Go to the main directory, which is under g-simulator/
> nosetests tests/*

3. Naming convention for test files: please make sure all the file names are
[class_name]_tests.py, or the test will fail.

4. Import libraries for testing
for example, we want to test message.py file:
> from nose.tools import *
> from pygnutella.message import Message

gnutella-simulator's People

Contributors

daifu avatar khaing211 avatar taipham avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.