[fedocal] master: Update documentation wrt the addition of the SMTP_SERVER field in the configuration (60e8268)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 60e8268a030c419dd3687413941dce434520e662
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Fri Nov 23 18:32:37 2012 +0100
Update documentation wrt the addition of the SMTP_SERVER field in the configuration
>---------------------------------------------------------------
doc/configuration.rst | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/doc/configuration.rst b/doc/configuration.rst
index 9f861a8..ee4437c 100644
--- a/doc/configuration.rst
+++ b/doc/configuration.rst
@@ -46,3 +46,15 @@ fedocal instance.
See :doc:`usage` for details explanations on the different administration layer
of fedocal.
+
+The SMTP server address
+-----------------------
+
+Fedocal sends reminder emails for the meeting for which it has been asked.
+This tasks is performed by an hourly cron job.
+The ``SMTP_SERVER`` field in the configuration file refers to the address
+of the `SMTP <http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol>`
+server to use to send these reminders.
+
+
+This field defaults to ``SMTP_SERVER='localhost'``.
10 years, 4 months
[fedocal] master: Move the address of the SMTP server used to send the emails to the configuration file (d52ec0a)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit d52ec0ad2cabcdf365e0996be6158a28c7f8ad11
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Fri Nov 23 18:23:32 2012 +0100
Move the address of the SMTP server used to send the emails to the configuration file
Up to now the SMTP address was hard-coded to 'localhost', this commit changes this
allowing one to specify a specific SMTP server to use to send the emails.
Emails are only sent via the cron job which is run hourly to send reminders.
Fixes #14
>---------------------------------------------------------------
fedocal.cfg.sample | 5 +++++
fedocal/default_config.py | 5 +++++
fedocal_cron.py | 24 ++++++------------------
3 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/fedocal.cfg.sample b/fedocal.cfg.sample
index d68897d..535ce59 100644
--- a/fedocal.cfg.sample
+++ b/fedocal.cfg.sample
@@ -10,3 +10,8 @@ DB_URL='sqlite:////tmp/fedocal_dev.sqlite'
### The FAS group in which the admin of fedocal are
ADMIN_GROUP='fedocal_admin'
+
+### The address of the SMTP server used to send the reminders emails
+### via the cron job.
+### Default: 'localhost'
+SMTP_SERVER='localhost'
diff --git a/fedocal/default_config.py b/fedocal/default_config.py
index 81f6e92..95c7351 100644
--- a/fedocal/default_config.py
+++ b/fedocal/default_config.py
@@ -30,3 +30,8 @@ DB_URL = 'sqlite:////tmp/fedocal_dev.sqlite'
# The FAS group in which the admin of fedocal are
ADMIN_GROUP = 'fedocal_admin'
+
+
+# The address of the SMTP server used to send the reminders emails
+# via the cron job.
+SMTP_SERVER='localhost'
diff --git a/fedocal_cron.py b/fedocal_cron.py
index 5e885c7..3c577e5 100644
--- a/fedocal_cron.py
+++ b/fedocal_cron.py
@@ -33,10 +33,9 @@ import os
from email.mime.text import MIMEText
-import sys
-sys.path.insert(0, 'fedocal')
+import fedocal
+import fedocal.fedocallib as fedocallib
-from fedocal import fedocallib
def send_reminder_meeting(meeting):
""" This function sends the actual reminder of a given meeting.
@@ -67,17 +66,18 @@ Please note:
# Send the message via our own SMTP server, but don't include the
# envelope header.
- s = smtplib.SMTP('localhost')
+ s = smtplib.SMTP(fedocal.APP.config['SMTP_SERVER'])
s.sendmail(from_email,
meeting.reminder.reminder_to,
msg.as_string())
s.quit()
-def send_reminder(db_url):
+def send_reminder():
""" Retrieve all the meeting for which we should send a reminder and
do it.
"""
+ db_url = fedocal.APP.config['DB_URL']
session = fedocallib.create_session(db_url)
meetings = fedocallib.retrieve_meeting_to_remind(session)
for meeting in meetings:
@@ -85,16 +85,4 @@ def send_reminder(db_url):
if __name__ == '__main__':
- sys.argv.append('fedocal/fedocal.cfg')
- config = ConfigParser.ConfigParser()
- if len(sys.argv) == 1:
- if os.path.exists('/etc/fedocal.cfg'):
- config.readfp(open('/etc/fedocal.cfg'))
- else:
- print 'No config file found in /etc or specified to the cron.'
- elif len(sys.argv) == 2:
- if os.path.exists(sys.argv[1]):
- config.readfp(open(sys.argv[1]))
- else:
- print 'Config file specified to the cron could not be found.'
- send_reminder(config.get('fedocal', 'db_url'))
+ send_reminder()
10 years, 4 months
[fedocal] master: Update documentation - Development (4392d38)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 4392d389dd3a0c36c5fd03ad27cc9d526a4849a1
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 18 15:15:35 2012 +0100
Update documentation - Development
- Add note about python-coverage
- Update to use the createdb and runserver shell script
- Fix formatting in the alembic section
>---------------------------------------------------------------
doc/development.rst | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/doc/development.rst b/doc/development.rst
index f87f37f..836d5c9 100644
--- a/doc/development.rst
+++ b/doc/development.rst
@@ -29,11 +29,11 @@ See :doc:`configuration` for more detailed information about the configuration.
Create the database scheme::
- python fedocal/fedocallib/model.py
+ ./createdb
Run the server::
- python fedocal/__init__.py
+ ./runserver
You should be able to access the server at http://localhost:5000
@@ -122,6 +122,13 @@ by alone, allowing easier debugging of the tests. For example:
python fedocal/tests/test_week.py
+.. note:: In order to have the coverage information you might have to
+ install ``python-coverage``
+
+ ::
+
+ yum install python-coverage
+
Database changes
----------------
@@ -142,6 +149,7 @@ information on how to make a revision to the database schema.
The basic idea is to create a revision using (in the top folder):
::
+
alembic revision -m "<description of the change>"
Then edit the file generated in alembic/versions/ to add the correct command
10 years, 4 months
[fedocal] master: Update documentation - Deployment (72675e2)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 72675e2b037c01b698c96ad4686c64ac6ef6d03c
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 18 15:16:57 2012 +0100
Update documentation - Deployment
- Update information on how to deploy with wsgi
- Update information on how to create the database
>---------------------------------------------------------------
doc/deployment.rst | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/doc/deployment.rst b/doc/deployment.rst
index f238cc6..6e2b060 100644
--- a/doc/deployment.rst
+++ b/doc/deployment.rst
@@ -35,17 +35,17 @@ Find the sample configuration file::
rpm -ql fedocal |grep fedocal.cfg.sample
-Copy this file into ``/etc/`` with the name ``fedocal.cfg``::
+Copy this file into (for example) ``/etc/`` with the name ``fedocal.cfg``::
cp /path/to/fedocal.cfg.sample /etc/fedocal.cfg
Find the file used to create the database::
- rpm -ql fedocal |grep model.py
+ rpm -ql fedocal |grep createdb.py
Create the database scheme::
- python path/to/fedocal/fedocallib/model.py
+ FEDOCAL_CONFIG=/etc/fedocal/cfg python path/to/createdb.py
Set up the WSGI as described below.
@@ -73,6 +73,8 @@ and put in this file::
Then create the file /var/www/wsgi/fedocal.wsgi with::
+ import os
+ os.environ['FEDOCAL_CONFIG'] = '/etc/fedocal.cfg'
import fedocal
application = fedocal.APP
@@ -86,6 +88,10 @@ Then create the file /var/www/wsgi/fedocal.wsgi with::
Adapt the path to your configuration
+.. seealso:: Within the sources of fedocal is a ``fedocal.wsgi`` which
+ can be used as a template for your own wsgi.
+
+
Then restart apache and you should be able to access the website on
http://localhost/fedocal
10 years, 4 months
[fedocal] master: Update documentation - Update usage (52f263e)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 52f263ee20873ff879374ee41cdb1fa2f2b5eb56
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 18 15:16:16 2012 +0100
Update documentation - Update usage
- Update information regarding the times input field
- Add note about the timezone in the time input field
>---------------------------------------------------------------
doc/usage.rst | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/doc/usage.rst b/doc/usage.rst
index f3af99e..b9bfc83 100644
--- a/doc/usage.rst
+++ b/doc/usage.rst
@@ -92,13 +92,13 @@ When creating a meeting you will have to fill the form asking for:
the date in a calendar. Otherwise, you will have to provide the date using
the format: ``yyyy-mm-dd``.
-- ``meeting start time``: the time at which the meeting starts. At the moment
- you are only proposed with full hour times, we are working on allowing the
- half-hours.
+- ``meeting start time``: the time at which the meeting starts. It can be
+ any time although the calendar will only displays half-hour time slots.
+ It should be of the format: ``HH:MM``.
-- ``meeting start time``: the time at which the meeting stops. At the moment
- you are only proposed with full hour times, we are working on allowing the
- half-hours.
+- ``meeting stop time``: the time at which the meeting stops. It can be
+ any time although the calendar will only displays half-hour time slots.
+ It should be of the format: ``HH:MM``.
- ``co-manager``: by default the person creating the meeting is the manager of
the meeting. However, sometime you want to allow someone else to manage
@@ -134,6 +134,14 @@ When creating a meeting you will have to fill the form asking for:
reminders.
+.. note:: After the text field where to enter the times will be the
+ timezone in which those times should be entered. This timezone is
+ retrieved from your account on the `FAS
+ <https://admin.fedoraproject.org/accounts/>`_, otherwise the timezone
+ is `UTC <http://en.wikipedia.org/wiki/Coordinated_Universal_Time>`_.
+
+
+
Edit meeting
------------
10 years, 4 months
[fedocal] master: Update documentation - update variable cast to what they are in the configuration file (19736c4)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 19736c4536f97ebaabb0b65da110cbddbb8ae5c5
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 18 15:14:16 2012 +0100
Update documentation - update variable cast to what they are in the configuration file
>---------------------------------------------------------------
doc/configuration.rst | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/configuration.rst b/doc/configuration.rst
index af96b34..9f861a8 100644
--- a/doc/configuration.rst
+++ b/doc/configuration.rst
@@ -29,9 +29,9 @@ to the database.
Examples URLs are::
- db_url=mysql://user:pass@host/db_name
- db_url=postgres://user:pass@host/db_name
- db_url=sqlite:////full/path/to/database.sqlite
+ DB_URL=mysql://user:pass@host/db_name
+ DB_URL=postgres://user:pass@host/db_name
+ DB_URL=sqlite:////full/path/to/database.sqlite
The admin group
10 years, 4 months
[fedocal] master: pep8 and pylint run on default_config (6f7b5aa)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 6f7b5aa337fcbb2868790cae1a75999545d7359b
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sat Nov 17 20:06:34 2012 +0100
pep8 and pylint run on default_config
>---------------------------------------------------------------
fedocal/default_config.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fedocal/default_config.py b/fedocal/default_config.py
index 7648448..81f6e92 100644
--- a/fedocal/default_config.py
+++ b/fedocal/default_config.py
@@ -25,7 +25,8 @@
# url to the database server:
-DB_URL='sqlite:////tmp/fedocal_dev.sqlite'
+DB_URL = 'sqlite:////tmp/fedocal_dev.sqlite'
+
# The FAS group in which the admin of fedocal are
-ADMIN_GROUP='fedocal_admin'
+ADMIN_GROUP = 'fedocal_admin'
10 years, 4 months