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
611b5bd7
Commit
611b5bd7
authored
Dec 23, 1996
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If sys.argv is empty ask for input file and output folder
parent
e0dd34e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
Mac/scripts/unshar.py
Mac/scripts/unshar.py
+26
-0
No files found.
Mac/scripts/unshar.py
View file @
611b5bd7
...
...
@@ -69,3 +69,29 @@ def unshar(fp, verbose=0, overwrite=0):
file
=
None
continue
if
verbose
:
print
"..."
,
`line`
def
main
():
import
sys
import
os
if
len
(
sys
.
argv
)
>
1
:
for
fname
in
sys
.
argv
[
1
:]:
fp
=
open
(
fname
,
'r'
)
dir
,
fn
=
os
.
path
.
split
(
fname
)
if
dir
:
os
.
chdir
(
dir
)
unshar
(
fp
)
else
:
import
macfs
fss
,
ok
=
macfs
.
StandardGetFile
(
'TEXT'
)
if
not
ok
:
sys
.
exit
(
0
)
fname
=
fss
.
as_pathname
()
fp
=
open
(
fname
,
'r'
)
fss
,
ok
=
macfs
.
GetDirectory
(
'Folder to save files in:'
)
if
not
ok
:
sys
.
exit
(
0
)
os
.
chdir
(
fss
.
as_pathname
())
unshar
(
fp
)
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