Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading bootstrap #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ target/

# Lalita
lalita.log
lalita.cfg
3 changes: 0 additions & 3 deletions CHANGES.txt

This file was deleted.

22 changes: 14 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ lalita is written with some goals in mind:
All the code in lalita is licensed under GNU GPL v3. See LICENSE.txt for
further info.

The project page is::

https://edge.launchpad.net/lalita
The project page is `https://github.com/PyAr/lalita`

To run the bot, create a config file (you can use the sample lalita.cfg.sample)
as a guideline, and run::

ircbot.py -c <configfile> <server>

There're a lot of test cases! You can try them running "nosetests" (you
need to have Nose installed).
There're a lot of test cases! You can try them running ``./test`` (you
need to have `fades <https://github.com/PyAr/fades>`_ installed).

To create a plugin, check the plugins/example.py one, and use it as a start.

Expand Down Expand Up @@ -68,14 +66,22 @@ configure with --manhole-port) is accesible from internet or other machines.
How to run lalita without installing
====================================

From the top-level directory run::
First you have to install the dependecies (maybe you want to do it inside a virtualenv)::

pip install -r requirements.txt

PYTHONPATH=. python lalita/ircbot.py
From the top-level directory and inside a virtualenv run::

python lalita/ircbot.py

For example, setting logs in debug mode, pointing to the sample
configuration, and choosing a server in localhost::

PYTHONPATH=. python lalita/ircbot.py -o DEBUG lalita.cfg.sample localhost
python lalita/ircbot.py -o DEBUG lalita.cfg.sample localhost

Or if you have `fades` installed just run::

./run_lalita -o DEBUG lalita.cfg.sample localhost


How To do a source release
Expand Down
File renamed without changes.
14 changes: 2 additions & 12 deletions docs/tutorial_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,9 @@ The next dialogue is an example of this example running in real life::


How do I test this example?
----------------------

Lalita is a Python module. To run Lalita, you need to install Python,
``http://www.python.org/getit`` and the Twisted module for Python
``http://twistedmatrix.com/trac/wikiDonwloads``.

If you have setuptools, you can install Lalita by entering
``easy_install lalita`` in a terminal. also you can get Lalita in a tarball,
from ``https://edge.launchpad.net/lalita`` or if you have bazaar, you can
download the complete project with ``bzr branch lp:lalita``.
---------------------------

If you have already downloaded Lalita you can uncompress it in any folder, go
to that folder and run ``python setup.py install``.
First you have to install lalita. Check the instructions in the `README.rst` file.

After installing, you can access the installed folder, there you will see many
files, now we will focus on three.
Expand Down
5 changes: 2 additions & 3 deletions docs/tutorial_sp.rst → docs/tutorial_es.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@ Las siguientes lineas muestran el diálogo con el bot (que llamamos
----------------------

Para probar Lalita no hace falta realizar ninguna instalación en particular.
Se puede bajar y descomprimir un tarball, o incluso bajar todo el proyecto
entero haciendo ``bzr branch lp:lalita``, y usarlo directamente.
Podés chequear los pasos de instalación en el archivo `README.rst`.

En los siguientes párrafos explicamos qué es cada cosa, pero para
directamente probar lalita, entrar al directorio con el proyecto y hacer::

PYTHONPATH=. python lalita/ircbot.py lalita.cfg.sample example-freenode
python lalita/ircbot.py lalita.cfg.sample example-freenode

Luego entrar con nuestro cliente preferido a Freenode, al canal
``#lalita-example``, y probamos::
Expand Down
2 changes: 1 addition & 1 deletion lalita.cfg.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ servers = {

# this is the character that will indicate that a command to lalita
# is issued
command_char = '@'
command_char = '@',

# the encoding used to connect to the server
encoding='utf8',
Expand Down
18 changes: 16 additions & 2 deletions lalita/ircbot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright 2009-2013 laliputienses
# Copyright 2009-2015 laliputienses
# License: GPL v3
# For further info, see LICENSE file

Expand All @@ -17,8 +17,22 @@
from twisted.internet import reactor, protocol, ssl
from twisted.words.protocols import irc

# this will be replaced at install time
INSTALLED_BASE_DIR = "@ INSTALLED_BASE_DIR @"

# get the replaced-at-install-time name if exists, or the project one
if os.path.exists(INSTALLED_BASE_DIR):
project_basedir = INSTALLED_BASE_DIR
else:
project_basedir = os.path.abspath(os.path.dirname(os.path.dirname(
os.path.realpath(sys.argv[0]))))

if project_basedir not in sys.path:
sys.path.insert(0, project_basedir)


# local imports
from lalita import dispatcher, events
from lalita.core import dispatcher, events

LOG_LEVELS = {
"debug": logging.DEBUG,
Expand Down
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BeautifulSoup>=3.2.1
Twisted>=15.4.0
zmq>=0.0.0
pyopenSSL>=0.15.1
service_identity>=14.0.0
txZMQ>=0.7.0
flake8>=2.4.1
nose>=1.3.7
5 changes: 5 additions & 0 deletions run_lalita
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
#
FADES='fades -r requirements.txt --python=python2'

$FADES lalita/ircbot.py $@
15 changes: 15 additions & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#

set -eu

if [ $# -ne 0 ]; then
TARGET="$@"
else
TARGET="lalita"
fi

FADES='fades -r requirements.txt --python=python2'

$FADES -x nosetests -v -s $TARGET
$FADES -x flake8 -- $TARGET --max-line-length=99 --select=E,W,F,C,N
1 change: 1 addition & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<title>Lalita</title>
</head>
<body>
<h1>DOCUMENTACION OBSOLETA</h1>
<h1>Lalita</h1>
<p>¡Bienvenidos a Lalita! - <a href="index_en.html">Welcome to Lalita!</a></p>
<h2>¿Quién es Lalita?</h2>
Expand Down
1 change: 1 addition & 0 deletions web/index_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<title>Lalita</title>
</head>
<body>
<h1>DEPRECATED DOCS</h1>
<h1>Lalita</h1>
<p>¡Welcome to Lalita! - <a href="index.html">¡Bienvenidos a Lalita!</a></p>
<h2>Who is Lalita?</h2>
Expand Down
1 change: 1 addition & 0 deletions web/tutorial_sp.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@


<div class="section" id="lalita">
<h1>Documentacion Obsoleta</h1>
<h1>Lalita</h1>
<div class="section" id="quien-es-lalita">
<h2>¿Quién es Lalita?</h2>
Expand Down