[Tutor] Certificate creation.

2007-06-14 Thread Lance Haig
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,

Is there a way to create ssl certificates with python and GNUTLS?

I am part of a project http://www.bongo-project.org which is a mail and
calendering solution. We use python in our project to a large extent but
we have a problem with the ssl key generation using GNUTLS.

Some machines take days to create enough random data to create the
certificates because they are headless and don't have key input for us
to capture.

We currently use a python script to run our set-up program and this in
turn creates the certificates.

Is there another way to create certificates from a python script that
will speed things up for these types of machines?

I would appreciate any help on this thanks

Regards

Lance
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGcUsXOw09RVRgt9wRAgfkAJ993ha5e38OS5YAc0xAaDg7GMGxRgCgnfCR
j6oeFdWInj4xp2fIloiQxfM=
=TlaD
-END PGP SIGNATURE-
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] OT: Would this be difficult to do?

2007-01-30 Thread Lance Haig
Hi,

I have a need for a file system scanning tool that produces csv files of
data that is older than a specified date.

All the commercial ones I have found just don't quite do what I want.

I have been a lurker on this list for some time and was wondering if
this would be very difficult to do?

Any suggestions would be appreciated

Thanks

Lance

P.S. I an still learning Python. busy with Alan's tutorial



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] New Tutor topic(almost)

2007-02-16 Thread Lance Haig

Hi Alan,

Firstly thank you for the tutorials I have used your book and website to 
great affect.

I use the download on the train when I am travelling.

I have a question though.

Do you update the web page downloads every time you update the site?

I want to download a new copy and was hoping to get the latest one.

Thanks again

Lance




Alan Gauld wrote:
"Alan Gauld" <[EMAIL PROTECTED]> wrote in 

  
After a very long delay I finally got some work done on 
my networking with sockets topic in my tutorial. There is 
still a section to complete but the introductory explanations 
and examples are now on the site.


http://www.freenetpages.co.uk/hp/alan.gauld/tutsocket.htm

If anyone has any feedback I'd love to hear it.



OK, I finished it, the final address book example is now there too.

Enjoy,

  


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] how to determine where a module or function is called from

2007-02-22 Thread Lance Haig
I am debugging a script that was written by someone else and I was 
wondering if there is a way to determine where a function or module is 
imported from

Thanks

Lance
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] how to determine where a module or function is called from

2007-02-22 Thread Lance Haig
Hi Kent,

Thank you

I was able to find it in the end.



It was at the bottom of the file I was editing



Lance

Kent Johnson wrote:
> Lance Haig wrote:
>> I am debugging a script that was written by someone else and I was 
>> wondering if there is a way to determine where a function or module 
>> is imported from
>
> You can use the __file__ attribute of a module:
> In [9]: csv.__file__
> Out[9]: 
> '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/csv.pyc'
>
> For a function use the __module__ attribute to get the module:
> In [10]: csv.reader.__module__
> Out[10]: '_csv'
>
> This is a string so you have to do a little more work to get the file:
>
> In [12]: import sys
> In [13]: sys.modules[csv.reader.__module__].__file__
> Out[13]: 
> '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload/_csv.so'
>  
>
>
> Kent
>

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Can you tell me if this C or python please

2007-03-02 Thread Lance Haig
Hi,

I am helping on an OS project called bongo-project and I am trying to 
debug a script that is used for migration. When I run the file I get an 
error. I have traced it down to a file called libs.c.

I know that the file looks like a c file but I am confused by some of 
the code in it. I would appreciate it if someone could look at the file 
for me and tell me if it is c so I can pass it back to the c guys and 
ask them.

Thanks

Lance
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Can you tell me if this C or python please

2007-03-02 Thread Lance Haig
Bob Gailer wrote:
> Lance Haig wrote:
>> Hi,
>>
>> I am helping on an OS project called bongo-project and I am trying to 
>> debug a script that is used for migration. When I run the file I get 
>> an error. I have traced it down to a file called libs.c.
>>
>> I know that the file looks like a c file but I am confused by some of 
>> the code in it. I would appreciate it if someone could look at the 
>> file for me and tell me if it is c so I can pass it back to the c 
>> guys and ask them.
>>   
> OK. Show us the file (if not too big as body text).
>
sorry I should have attached it

/
 *
 * Copyright (c) 2006 Novell, Inc.
 * All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, contact Novell, Inc.
 *
 * To contact Novell about this file by physical or electronic mail,
 * you may find current contact information at www.novell.com
 *
 /

#include 
#include "libs.h"
#include "pybongo.h"
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#ifdef __cplusplus
extern "C" {
#endif

static PyMethodDef ModuleMethods[] = { {NULL} };

/* Pull in the methods from the bindings */
extern PyMethodDef CalCmdMethods[];
extern EnumItemDef CalCmdEnums[];
extern PyMethodDef CalMethods[];
extern PyMethodDef MdbMethods[];
extern EnumItemDef MdbEnums[];
extern PyMethodDef MsgApiMethods[];
extern EnumItemDef MsgApiEnums[];
extern PyMethodDef StreamIOMethods[];
extern PyMethodDef BongoJsonMethods[];
extern PyMethodDef BongoUtilMethods[];


PyMODINIT_FUNC
initlibs()
{
MDBHandle directoryHandle=NULL;
char dbfdir[PATH_MAX];

/* Initialize the various bongo libraries */
if (!MemoryManagerOpen((unsigned char*)"pybongo")) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: MemoryManagerOpen() failed");
return;
}

if (!ConnStartup(DEFAULT_CONNECTION_TIMEOUT, TRUE)) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: ConnStartup() failed");
return;
}

directoryHandle = MsgInit();
if (!directoryHandle) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: MsgInit() failed");
return;
}

MsgGetDBFDir(dbfdir);

if (!BongoCalInit(dbfdir)) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: BongoCalInit() failed");
return;
}

if (!NMAPInitialize(directoryHandle)) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: NMAPInitialize() failed");
return;
}

if (!StreamioInit()) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: StreamioInit() failed");
return;
}

if (!BongoJsonPreInit()) {
PyErr_SetString(PyExc_ImportError,
"bongo.libs error: BongoJsonPreInit() failed");
return;
}
   
/* Create the libs module */
PyObject *module = Py_InitModule("libs", ModuleMethods);

/* Add the Bongo libs */
AddLibrary(module, "cal", CalMethods, NULL);
AddLibrary(module, "calcmd", CalCmdMethods, CalCmdEnums);
AddLibrary(module, "mdb", MdbMethods, MdbEnums);
AddLibrary(module, "msgapi", MsgApiMethods, MsgApiEnums);
AddLibrary(module, "streamio", StreamIOMethods, NULL);
AddLibrary(module, "bongojson", BongoJsonMethods, NULL);
AddLibrary(module, "bongoutil", BongoUtilMethods, NULL);

BongoJsonPostInit(module);
BongoCalPostInit(module);
}

#ifdef __cplusplus
}
#endif
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Can you tell me if this C or python please

2007-03-02 Thread Lance Haig
Bob,

Thanks a million

I will start talking to the other guys

Thanks

Lance
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Convert a text logfile to RSS xml.

2008-11-17 Thread Lance Haig


 Hi,  
 I was just thinking how to improve our opensource Website and was
wondering if there is an easy way to convert say an IRC logfile to an
rss feed using pyton?  
 I was thinking about running the script with cron that will scan the
latest logfile for the day and convert it to rss xml std   

 it would overwrite the rss feed file everytime and then when a new
day starts the xml file is overwritten.  

  How would you do this? and do you have any suggestions?  

 I was also thinking of importing the logfiles into a small sqllite
db and then convertinbg the sqldb into a feed.   

  Regards  
 Lance  ___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor