Commit 4f89995f authored by Hanno Schlichting's avatar Hanno Schlichting

Fixed copyright headers and PEP8 changes

parent 912f7582
############################################################################## ##############################################################################
# #
# This was yanked out of repoze.zope2 # Copyright (c) 2010 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
""" Add a Zope management user to the root Zope user folder """ """ Add a Zope management user to the root Zope user folder """
import sys import sys
from Zope2.utilities.finder import ZopeFinder from Zope2.utilities.finder import ZopeFinder
def adduser(app, user, pwd): def adduser(app, user, pwd):
import transaction import transaction
result = app.acl_users._doAddUser(user, pwd, ['Manager'], []) result = app.acl_users._doAddUser(user, pwd, ['Manager'], [])
transaction.commit() transaction.commit()
return result return result
def main(argv=sys.argv): def main(argv=sys.argv):
import sys import sys
try: try:
...@@ -29,4 +37,3 @@ def main(argv=sys.argv): ...@@ -29,4 +37,3 @@ def main(argv=sys.argv):
if __name__ == '__main__': if __name__ == '__main__':
main() main()
############################################################################## ##############################################################################
# #
# yanked from repoze.zope2 # Copyright (c) 2010 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
import os import os
class ZopeFinder: class ZopeFinder:
def __init__(self, argv): def __init__(self, argv):
self.cmd = argv[0] self.cmd = argv[0]
...@@ -38,4 +47,3 @@ class ZopeFinder: ...@@ -38,4 +47,3 @@ class ZopeFinder:
default_config_file = os.path.join(ihome, 'etc', 'zope.conf') default_config_file = os.path.join(ihome, 'etc', 'zope.conf')
zope_conf = os.environ.get('ZOPE_CONF', default_config_file) zope_conf = os.environ.get('ZOPE_CONF', default_config_file)
return zope_conf return zope_conf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment