1
0
Fork 0

- fixed tools.py to explain why crypt is not available

- removed old xmlrpcservertest.py

git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@169 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2006-02-23 16:52:32 +00:00
parent 979db1b333
commit b37343bad9
3 changed files with 7 additions and 28 deletions

View file

@ -5,7 +5,12 @@
import random, re
from gnuviech import GNVPrefs
from crypt import crypt
try:
from crypt import crypt
except ImportError, ie:
import sys
sys.__stderr__.write("Unsupported platform without crypt: " + sys.platform)
sys.exit()
from time import time
def generatePassword():

View file

@ -130,6 +130,6 @@ class POP3Account(MailAccount):
if __name__ == "__main__":
prefs = GNVPrefs()
domain = GNVDomain("dittberner.info", prefs)
domain = GNVDomain("test.local", prefs)
domain.addPOP3Account(POP3Account(domain, "test"))
domain.addMailAlias(MailAlias(domain, "klaus", "klaus@test.de"))

View file

@ -1,26 +0,0 @@
from DocXMLRPCServer import DocXMLRPCServer
import traceback
import pwd
class TestService:
def listUsers(self):
"""Lists all system users."""
entries = [":".join((item[0], str(item[2]), str(item[3]), item[4])) for item in pwd.getpwall() if item[0].find("usr")==0]
return "\n".join(entries)
def startRPCServer():
server = DocXMLRPCServer(("localhost", 8080))
server.register_introspection_functions()
server.register_instance(TestService())
try:
server.serve_forever()
except KeyboardInterrupt:
server.server_close()
if __name__ == "__main__":
service = TestService()
print service.listUsers()
startRPCServer()