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
Open sidebar
pipelet
Pipelet
Commits
e2038324
Commit
e2038324
authored
Sep 02, 2010
by
Maude Le Jeune
Browse files
Feature #850 en cours
parent
db32e435
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
11 deletions
+23
-11
pipelet/launchers.py
pipelet/launchers.py
+8
-1
pipelet/pipeline.py
pipelet/pipeline.py
+6
-1
pipelet/utils.py
pipelet/utils.py
+9
-9
scripts/main.py
scripts/main.py
+0
-0
scripts/seg_default_code.py
scripts/seg_default_code.py
+0
-0
No files found.
pipelet/launchers.py
View file @
e2038324
...
...
@@ -51,7 +51,14 @@ import sys
import
datetime
def
get_log_file
(
pipe
,
name
):
"""
""" Return log file name
Current date time is prepend to the log file name.
Parameters
----------
pipe: pipe instance
name: log file short name
"""
d
=
datetime
.
datetime
.
now
()
strdate
=
d
.
strftime
(
"%y%m%d_%H%M%s%f"
)
...
...
pipelet/pipeline.py
View file @
e2038324
...
...
@@ -113,7 +113,12 @@ class Pipeline:
self
.
repository
=
LocalRepository
(
code_dir
)
## string, indicates where to save the pipeline products.
self
.
_prefix
=
prefix
if
not
os
.
path
.
exists
(
prefix
):
os
.
mkdir
(
prefix
)
logdir
=
os
.
path
.
join
(
prefix
,
"log"
)
if
not
os
.
path
.
exists
(
logdir
):
os
.
mkdir
(
logdir
)
## dict, directory corresponding to each segment
self
.
_curr_dirs
=
{}
## dict, hash key corresponding to each segment
...
...
pipelet/utils.py
View file @
e2038324
...
...
@@ -235,17 +235,17 @@ def create_pipe(pipename, prefix=[]):
os
.
mkdir
(
code_dir
)
## make prefix and log dir
if
prefix
:
if
not
os
.
path
.
exists
(
prefix
):
os
.
mkdir
(
prefix
)
else
:
prefix
=
code_dir
logdir
=
os
.
path
.
join
(
prefix
,
"log"
)
if
not
os
.
path
.
exists
(
logdir
):
os
.
mkdir
(
logdir
)
if
not
prefix
:
prefix
=
code_dir
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
code_dir
,
"main.py"
)):
shutil
.
copy
(
current_dir
+
"/static/main.py"
,
code_dir
)
## make a main file with some doc
fn
=
current_dir
+
"/static/main.py"
with
closing
(
file
(
fn
,
'r'
))
as
f
:
str
=
f
.
read
()
str
=
str
.
replace
(
"prefix = './'"
,
"prefix = '%s'"
%
prefix
)
fn
=
os
.
path
.
join
(
code_dir
,
"main.py"
)
with
closing
(
file
(
fn
,
'w'
))
as
f
:
f
.
write
(
str
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
code_dir
,
"seg_default_code.py"
)):
shutil
.
copy
(
current_dir
+
"/static/seg_default_code.py"
,
code_dir
)
## make a segment file with some doc
...
...
scripts/main.py
0 → 100644
View file @
e2038324
scripts/seg_default_code.py
0 → 100644
View file @
e2038324
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