Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9cba55b3
Commit
9cba55b3
authored
Jan 05, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python/build/project.py: add "edits" parameter to edit source files
parent
c2cbb7b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
project.py
python/build/project.py
+14
-1
No files found.
python/build/project.py
View file @
9cba55b3
...
...
@@ -7,6 +7,7 @@ from build.tar import untar
class
Project
:
def
__init__
(
self
,
url
,
md5
,
installed
,
name
=
None
,
version
=
None
,
base
=
None
,
edits
=
None
,
use_cxx
=
False
):
if
base
is
None
:
basename
=
os
.
path
.
basename
(
url
)
...
...
@@ -28,6 +29,7 @@ class Project:
self
.
md5
=
md5
self
.
installed
=
installed
self
.
edits
=
edits
self
.
use_cxx
=
use_cxx
def
download
(
self
,
toolchain
):
...
...
@@ -47,7 +49,18 @@ class Project:
parent_path
=
toolchain
.
src_path
else
:
parent_path
=
toolchain
.
build_path
return
untar
(
self
.
download
(
toolchain
),
parent_path
,
self
.
base
)
path
=
untar
(
self
.
download
(
toolchain
),
parent_path
,
self
.
base
)
if
self
.
edits
is
not
None
:
for
filename
,
function
in
self
.
edits
.
items
():
with
open
(
os
.
path
.
join
(
path
,
filename
),
'r+t'
)
as
f
:
old_data
=
f
.
read
()
new_data
=
function
(
old_data
)
f
.
seek
(
0
)
f
.
truncate
(
0
)
f
.
write
(
new_data
)
return
path
def
make_build_path
(
self
,
toolchain
):
path
=
os
.
path
.
join
(
toolchain
.
build_path
,
self
.
base
)
...
...
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