Skip to content

Commit

Permalink
Remove unused/broken modify_tree_fields and related functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordibc committed Feb 21, 2024
1 parent 8f2e0df commit 8589f3b
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions ete4/smartview/gui/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,6 @@ def callback():
response.status = 201
return {'message': 'ok', 'ids': ids}

@put('/trees/<tree_id>')
def callback(tree_id):
modify_tree_fields(tree_id)
return {'message': 'ok'}

@put('/trees/<tree_id>/sort')
def callback(tree_id):
node_id, key_text, reverse = req_json()
Expand Down Expand Up @@ -1457,17 +1452,6 @@ def write_tree_data():
return tid


def modify_tree_fields(tree_id):
"Modify in the database the tree fields that appear in a request"
tid = int(tree_id)

data = get_fields(valid_extra=[
'name', 'description', 'newick'])

if not data:
return {'message': 'ok'}


def update_app_available_layouts():
try:
module_reload(layout_modules)
Expand Down Expand Up @@ -1557,20 +1541,6 @@ def del_tree(tid):
app.trees.pop(tid, None)


def get_fields(required=None, valid_extra=None):
"Return fields and raise exception if missing required or invalid present"
data = req_json()

if required and any(x not in data for x in required):
abort(400, f'must have the fields {required}')

valid = (required or []) + (valid_extra or [])
if not all(x in valid for x in data):
abort(400, f'can only have the fields {valid}')

return data


def copy_style(tree_style):
def add_faces_to_header(header, facecontainer):
for column, face_list in facecontainer.items():
Expand Down

0 comments on commit 8589f3b

Please sign in to comment.