Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
pipelet
Pipelet
Commits
423d1c24
Commit
423d1c24
authored
Feb 08, 2011
by
Betoule Marc
Browse files
Modify the behavior of depend to retrieve filename with variable expansion
parent
c4d1d03c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
pipelet/repository.py
pipelet/repository.py
+20
-1
No files found.
pipelet/repository.py
View file @
423d1c24
...
...
@@ -115,7 +115,7 @@ class Repository:
depend
=
self
.
get_directive
(
Depend
,
s
)
self
.
_deps
[
s
]
=
""
for
fn
in
depend
.
deps
:
source
=
self
.
get_
code_source
(
fn
)
source
=
self
.
get_
file_content
(
fn
)
self
.
_deps
[
s
]
+=
source
def
get_all_string
(
self
,
seg
):
...
...
@@ -235,6 +235,25 @@ class Repository:
import
pydoc
return
pydoc
.
source_synopsis
(
self
.
_code
[
seg
].
co_filename
)
def
get_file_content
(
self
,
filename
):
""" Read content of a given file
This is the default to read dependencies of a segment.
Parameters
----------
filename: string
Returns
-------
string, content of file
"""
fid
=
open
(
path
.
expandvars
(
path
.
expanduser
(
filename
)),
"r"
)
code
=
fid
.
read
()
fid
.
close
()
return
code
class
LocalRepository
(
Repository
):
""" A local repository.
...
...
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