Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
4f89995f
Commit
4f89995f
authored
Jun 24, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed copyright headers and PEP8 changes
parent
912f7582
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
src/Zope2/utilities/adduser.py
src/Zope2/utilities/adduser.py
+10
-3
src/Zope2/utilities/finder.py
src/Zope2/utilities/finder.py
+10
-2
No files found.
src/Zope2/utilities/adduser.py
View file @
4f89995f
##############################################################################
#
# 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 """
import
sys
from
Zope2.utilities.finder
import
ZopeFinder
def
adduser
(
app
,
user
,
pwd
):
import
transaction
result
=
app
.
acl_users
.
_doAddUser
(
user
,
pwd
,
[
'Manager'
],
[])
transaction
.
commit
()
return
result
def
main
(
argv
=
sys
.
argv
):
import
sys
try
:
...
...
@@ -29,4 +37,3 @@ def main(argv=sys.argv):
if
__name__
==
'__main__'
:
main
()
src/Zope2/utilities/finder.py
View file @
4f89995f
##############################################################################
#
# 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
class
ZopeFinder
:
def
__init__
(
self
,
argv
):
self
.
cmd
=
argv
[
0
]
...
...
@@ -38,4 +47,3 @@ class ZopeFinder:
default_config_file
=
os
.
path
.
join
(
ihome
,
'etc'
,
'zope.conf'
)
zope_conf
=
os
.
environ
.
get
(
'ZOPE_CONF'
,
default_config_file
)
return
zope_conf
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment