Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
f6a06d79
Commit
f6a06d79
authored
Oct 15, 2008
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #4072: Restore build_py_2to3. Add a distutils demo for
build_py_2to3.
parent
9dda0b58
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
command/build_py.py
command/build_py.py
+18
-12
No files found.
command/build_py.py
View file @
f6a06d79
...
...
@@ -384,6 +384,18 @@ class build_py (Command):
byte_compile
(
files
,
optimize
=
self
.
optimize
,
force
=
self
.
force
,
prefix
=
prefix
,
dry_run
=
self
.
dry_run
)
from
lib2to3.refactor
import
RefactoringTool
,
get_fixers_from_package
class
DistutilsRefactoringTool
(
RefactoringTool
):
def
log_error
(
self
,
msg
,
*
args
,
**
kw
):
# XXX ignores kw
log
.
error
(
msg
,
*
args
)
def
log_message
(
self
,
msg
,
*
args
):
log
.
info
(
msg
,
*
args
)
def
log_debug
(
self
,
msg
,
*
args
):
log
.
debug
(
msg
,
*
args
)
class
build_py_2to3
(
build_py
):
def
run
(
self
):
self
.
updated_files
=
[]
...
...
@@ -396,18 +408,12 @@ class build_py_2to3(build_py):
self
.
build_package_data
()
# 2to3
from
lib2to3.refactor
import
RefactoringTool
class
Options
:
pass
o
=
Options
()
o
.
doctests_only
=
False
o
.
fix
=
[]
o
.
list_fixes
=
[]
o
.
print_function
=
False
o
.
verbose
=
False
o
.
write
=
True
r
=
RefactoringTool
(
o
)
r
.
refactor_args
(
self
.
updated_files
)
fixers
=
get_fixers_from_package
(
'lib2to3.fixes'
)
options
=
dict
(
fix
=
[],
list_fixes
=
[],
print_function
=
False
,
verbose
=
False
,
write
=
True
)
r
=
DistutilsRefactoringTool
(
fixers
,
options
)
r
.
refactor
(
self
.
updated_files
,
write
=
True
)
# Remaining base class code
self
.
byte_compile
(
self
.
get_outputs
(
include_bytecode
=
0
))
...
...
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