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
1bcdcd8c
Commit
1bcdcd8c
authored
Aug 14, 1995
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Binhexify any .rsrc file in a tree
parent
32d71c26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
Mac/scripts/binhextree.py
Mac/scripts/binhextree.py
+50
-0
No files found.
Mac/scripts/binhextree.py
0 → 100644
View file @
1bcdcd8c
#
# hexbintree - Recursively descend a directory and
# pack all resource files.
#
# Jack Jansen, CWI, August 1995.
#
# To do:
# - Also do project files (. and .), after using AppleEvents to the
# various builders to clean the projects
# - Don't hexbin (and clean) if there exists a .hqx file that is newer.
#
import
os
import
binhex
import
sys
extensions
=
[
'.rsrc'
]
def
walker
(
arg
,
top
,
names
):
for
n
in
names
:
for
ext
in
extensions
:
if
n
[
-
len
(
ext
):]
==
ext
:
name
=
os
.
path
.
join
(
top
,
n
)
print
'Binhexing'
,
name
binhex
.
binhex
(
name
,
name
+
'.hqx'
)
def
dodir
(
name
):
os
.
path
.
walk
(
name
,
walker
,
None
)
def
main
():
if
len
(
sys
.
argv
)
>
1
:
for
dir
in
sys
.
argv
[
1
:]:
dodir
(
dir
)
elif
os
.
name
==
'mac'
:
import
macfs
dir
,
ok
=
macfs
.
GetDirectory
(
'Folder to search:'
)
if
not
ok
:
sys
.
exit
(
0
)
dodir
(
dir
.
as_pathname
())
else
:
print
'Usage: hexbintree dir ...'
sys
.
exit
(
1
)
if
os
.
name
==
'mac'
:
sys
.
exit
(
1
)
# Keep window
else
:
sys
.
exit
(
0
)
if
__name__
==
'__main__'
:
main
()
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