root / pycommunity / pycy

Revision 74:c54d9c90e732, 1.5 kB (checked in by Tarek Ziad?? <tarek@…>, 17 months ago)

fixed setup

  • Property exe set to *
Line 
1#!/usr/bin/python
2# -*- coding: UTF-8 -*-
3#
4# Copyright (c) 2006 Tarek Ziadé <tarek@ziade.org>
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# as published by the Free Software Foundation; either version 2
9# of the License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19# $Id: $
20import sys
21import logging
22
23from pycommunity.sitebuilder import tasks
24from pycommunity.sitebuilder import buildSite
25
26logging.basicConfig(level=logging.DEBUG,
27                    format='%(asctime)s %(levelname)s %(message)s',
28                    filename='pycommunity.log',
29                    filemode='w')
30
31console = logging.StreamHandler()
32console.setLevel(logging.INFO)
33formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
34console.setFormatter(formatter)
35logging.getLogger('').addHandler(console)
36
37if __name__ == '__main__':
38    logging.info('Starting site building')
39    if len(sys.argv) > 1:
40        buildSite(sys.argv[1])
41    else:
42        buildSite('/etc/pycommunity/pycommunity.conf')
43    logging.info('Site building ended.')
Note: See TracBrowser for help on using the browser.