Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b8da8d77
Commit
b8da8d77
authored
Aug 09, 2002
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tool to pre-created cached .rsrc.df.rsrc files in the Lib directories,
similar to compileall.py.
parent
b6434f2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
Mac/scripts/cachersrc.py
Mac/scripts/cachersrc.py
+45
-0
No files found.
Mac/scripts/cachersrc.py
0 → 100644
View file @
b8da8d77
# Scan the tree passed as argv[0] for .rsrc files, skipping .rsrc.df.rsrc
# files, and open these. The effect of this is to create the .rsrc.df.rsrc
# cache files if needed.
# These are needed on OSX: the .rsrc files are in reality AppleSingle-encoded
# files. We decode the resources into a datafork-based resource file.
import
macresource
import
os
import
sys
import
getopt
class
NoArgsError
(
Exception
):
pass
def
handler
((
verbose
,
force
),
dirname
,
fnames
):
for
fn
in
fnames
:
if
fn
[
-
5
:]
==
'.rsrc'
and
fn
[
-
13
:]
!=
'.rsrc.df.rsrc'
:
if
force
:
try
:
os
.
unlink
(
os
.
path
.
join
(
dirname
,
fn
+
'.df.rsrc'
))
except
IOError
:
pass
macresource
.
open_pathname
(
os
.
path
.
join
(
dirname
,
fn
),
verbose
=
verbose
)
def
main
():
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'vf'
)
if
not
args
:
raise
NoArgsError
except
(
getopt
.
GetoptError
,
NoArgsError
):
sys
.
stderr
.
write
(
'Usage: cachersrc.py dirname ...
\
n
'
)
sys
.
exit
(
1
)
verbose
=
0
force
=
0
for
o
,
v
in
opts
:
if
o
==
'-v'
:
verbose
=
1
if
o
==
'-f'
:
force
=
1
for
dir
in
sys
.
argv
[
1
:]:
os
.
path
.
walk
(
dir
,
handler
,
(
verbose
,
force
))
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
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