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
400afd32
Commit
400afd32
authored
Jul 24, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move compilezpy and decompilezpy from Zope.Startup into utilities.
parent
cf165370
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
83 deletions
+0
-83
lib/python/Zope/Startup/compilezpy.py
lib/python/Zope/Startup/compilezpy.py
+0
-68
lib/python/Zope/Startup/decompilezpy.py
lib/python/Zope/Startup/decompilezpy.py
+0
-15
No files found.
lib/python/Zope/Startup/compilezpy.py
deleted
100644 → 0
View file @
cf165370
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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
compileall
,
os
,
sys
class
Shutup
:
def
write
(
*
args
):
pass
# :)
class
NoteErr
:
wrote
=
0
def
write
(
self
,
*
args
):
self
.
wrote
=
1
apply
(
stderr
.
write
,
args
)
def
compile_non_test
(
dir
):
"""Byte-compile all modules except those in test directories."""
success
=
compileall
.
compile_dir
(
dir
,
maxlevels
=
0
)
try
:
names
=
os
.
listdir
(
dir
)
except
os
.
error
:
print
"Can't list"
,
dir
names
=
[]
names
.
sort
()
for
name
in
names
:
fullname
=
os
.
path
.
join
(
dir
,
name
)
if
(
name
!=
os
.
curdir
and
name
!=
os
.
pardir
and
os
.
path
.
isdir
(
fullname
)
and
not
os
.
path
.
islink
(
fullname
)
and
name
!=
'test'
and
name
!=
'tests'
and
name
!=
'skins'
):
success
=
success
and
compile_non_test
(
fullname
)
return
success
print
print
'-'
*
78
print
'Compiling python modules'
stdout
=
sys
.
stdout
stderr
=
sys
.
stderr
try
:
try
:
success
=
0
sys
.
stdout
=
Shutup
()
sys
.
stderr
=
NoteErr
()
success
=
compile_non_test
(
os
.
getcwd
())
finally
:
success
=
success
and
not
sys
.
stderr
.
wrote
sys
.
stdout
=
stdout
sys
.
stderr
=
stderr
except
:
success
=
0
import
traceback
traceback
.
print_exc
()
if
not
success
:
print
print
'!'
*
78
print
'There were errors during Python module compilation.'
print
'!'
*
78
print
sys
.
exit
(
1
)
lib/python/Zope/Startup/decompilezpy.py
deleted
100644 → 0
View file @
cf165370
import
os
import
sys
def
main
(
dirname
):
os
.
path
.
walk
(
dirname
,
rmpycs
,
None
)
def
rmpycs
(
arg
,
dirname
,
names
):
for
name
in
names
:
path
=
os
.
path
.
join
(
dirname
,
name
)
if
(
name
.
endswith
(
'.pyc'
)
or
name
.
endswith
(
'.pyo'
)
and
os
.
path
.
isfile
(
path
)
):
os
.
unlink
(
path
)
if
__name__
==
'__main__'
:
main
(
sys
.
argv
[
1
])
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