Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Charles Burton
Gaudi
Commits
d67e4474
Commit
d67e4474
authored
Jul 10, 2016
by
Marco Clemencic
Browse files
do not use locker.py in genconfuser and ZipPythonDir
parent
67b05fe2
Changes
2
Hide whitespace changes
Inline
Side-by-side
GaudiKernel/scripts/genconfuser.py
View file @
d67e4474
...
...
@@ -133,9 +133,6 @@ def main():
help
=
"print some debugging information"
)
parser
.
add_option
(
"--debug"
,
action
=
"store_true"
,
help
=
"print more debugging information"
)
parser
.
add_option
(
"--lockerpath"
,
action
=
"store"
,
metavar
=
"DIRNAME"
,
help
=
"directory where to find the module 'locker'"
)
parser
.
set_defaults
(
root
=
os
.
path
.
join
(
".."
,
"python"
))
opts
,
args
=
parser
.
parse_args
()
...
...
@@ -170,23 +167,6 @@ def main():
else
:
outputfile
=
opts
.
output
# The locking ensures that nobody tries to modify the python.zip file while
# we read it.
dbLock
=
None
if
"GAUDI_BUILD_LOCK"
in
os
.
environ
:
if
opts
.
lockerpath
:
sys
.
path
.
append
(
opts
.
lockerpath
)
# Get the LockFile class from the locker module in GaudiPolicy or use a fake
# factory.
try
:
from
locker
import
LockFile
except
ImportError
:
def
LockFile
(
*
args
,
**
kwargs
):
return
None
# obtain the lock
dbLock
=
LockFile
(
os
.
environ
[
"GAUDI_BUILD_LOCK"
],
temporary
=
True
)
# We can disable the error on missing configurables only if we can import Gaudi.Configurables
# It must be done at this point because it may conflict with logging.basicConfig
try
:
...
...
@@ -210,7 +190,6 @@ def main():
package_module
.
__path__
.
insert
(
0
,
os
.
path
.
join
(
genConfDir
,
package_name
))
except
:
pass
# ignore failures (not important)
del
dbLock
# Now we can let the others operate on the install area python directory
# Collecting ConfigurableUser specializations
cus
=
{}
...
...
GaudiPolicy/scripts/ZipPythonDir.py
View file @
d67e4474
...
...
@@ -13,9 +13,6 @@ import re
import
codecs
from
StringIO
import
StringIO
# Add to the path the entry needed to import the locker module.
import
locker
## Class for generic exception coming from the zipdir() function
class
ZipdirError
(
RuntimeError
):
pass
...
...
@@ -138,7 +135,6 @@ def zipdir(directory, no_pyc = False):
# create the file, they do not truncate each other file
zipFile
=
open
(
filename
,
"ab"
)
locker
.
lock
(
zipFile
)
try
:
if
zipfile
.
is_zipfile
(
filename
):
infolist
=
zipfile
.
ZipFile
(
filename
).
infolist
()
...
...
@@ -174,7 +170,6 @@ def zipdir(directory, no_pyc = False):
log
.
error
(
"Probably you forgot the line '# -*- coding: utf-8 -*-'"
)
sys
.
exit
(
1
)
finally
:
locker
.
unlock
(
zipFile
)
zipFile
.
close
()
## Main function of the script.
...
...
@@ -202,10 +197,8 @@ def main(argv = None):
level
=
logging
.
WARNING
if
opts
.
debug
:
level
=
logging
.
DEBUG
logging
.
basicConfig
(
level
=
level
)
logging
.
basicConfig
(
level
=
level
)
if
"GAUDI_BUILD_LOCK"
in
os
.
environ
:
_scopedLock
=
locker
.
LockFile
(
os
.
environ
[
"GAUDI_BUILD_LOCK"
],
temporary
=
True
)
# zip all the directories passed as arguments
for
d
in
args
:
zipdir
(
d
,
opts
.
no_pyc
)
...
...
Write
Preview
Supports
Markdown
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