Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OBITools3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
20
Issues
20
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
dec114ee
Commit
dec114ee
authored
Jul 27, 2020
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python: added "date created" information in view representation
parent
f3669105
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
test.pyx
python/obitools3/commands/test.pyx
+4
-2
view.pyx
python/obitools3/dms/view/view.pyx
+9
-3
No files found.
python/obitools3/commands/test.pyx
View file @
dec114ee
...
...
@@ -23,6 +23,7 @@ from obitools3.dms.capi.obiview cimport NUC_SEQUENCE_COLUMN, \
import shutil
import string
import random
import sys
from cpython.exc cimport PyErr_CheckSignals
...
...
@@ -366,7 +367,7 @@ def random_new_view(config, infos, first=False):
infos['view'] = View_NUC_SEQS.new(infos['dms'], random_unique_name(infos), comments=random_comments(config)) # TODO quality column
else :
infos['view'] = View.new(infos['dms'], random_unique_name(infos), comments=random_comments(config)) # TODO quality column
infos['view'].write_config(config, "test", infos["command_line"], input_dms_name=[infos['dms'].name], input_view_name=["random"])
print_test(config, repr(infos['view']))
if v_to_clone is not None :
if line_selection is None:
...
...
@@ -497,7 +498,8 @@ def run(config):
(b"OBI_SEQ", False): random_seq, (b"OBI_SEQ", True): random_seq_tuples,
(b"OBI_STR", False): random_bytes, (b"OBI_STR", True): random_bytes_tuples
},
'tests': [test_set_and_get, test_add_col, test_delete_col, test_col_alias, test_new_view]
'tests': [test_set_and_get, test_add_col, test_delete_col, test_col_alias, test_new_view],
'command_line': " ".join(sys.argv[1:])
}
# TODO ???
...
...
python/obitools3/dms/view/view.pyx
View file @
dec114ee
...
...
@@ -184,9 +184,15 @@ cdef class View(OBIWrapper) :
@OBIWrapper
.
checkIsActive
def
__repr__
(
self
)
:
cdef
str
s
=
"#View name:
\n
{name:s}
\n
#Line count:
\n
{line_count:d}
\n
#Columns:
\n
"
.
format
(
name
=
bytes2str
(
self
.
name
),
line_count
=
self
.
line_count
)
def
__repr__
(
self
)
:
cdef
str
s
if
self
.
read_only
:
#
can
read
date
s
=
"#View name:
\n
{name:s}
\n
#Date created:
\n
{date:s}
\n
#Line count:
\n
{line_count:d}
\n
#Columns:
\n
"
.
format
(
name
=
bytes2str
(
self
.
name
),
line_count
=
self
.
line_count
,
date
=
str
(
bytes2str_object
(
self
.
comments
[
"Date created"
])))
else
:
s
=
"#View name:
\n
{name:s}
\n
#Line count:
\n
{line_count:d}
\n
#Columns:
\n
"
.
format
(
name
=
bytes2str
(
self
.
name
),
line_count
=
self
.
line_count
)
for
column_name
in
self
.
keys
()
:
s
=
s
+
repr
(
self
[
column_name
])
+
'\n'
return
s
...
...
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