Skip to content

Commit

Permalink
fix getting file name (#771)
Browse files Browse the repository at this point in the history
Co-authored-by: Wassim ELBouri <[email protected]>
  • Loading branch information
welbouri and Wassim ELBouri authored Feb 22, 2024
1 parent 1143e89 commit 515eb89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/canmatrix/formats/fibex.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

from __future__ import absolute_import, division, print_function

import os
import typing
from builtins import *
import lxml.etree
Expand Down Expand Up @@ -435,7 +436,7 @@ def dump(db, f, **options):
cluster = lxml.etree.SubElement(clusters, ns_fx + "CLUSTER")
cluster.set('ID', 'canCluster1')
# add the file name as a suffix in the cluster name
cluster_name = f"cluster_{f.name.split('.')[0]}"
cluster_name = f"cluster_{os.path.basename(f.name).split('.')[0]}"
create_short_name_desc(cluster, cluster_name, "clusterDesc")
create_sub_element_fx(cluster, "SPEED", "500")
create_sub_element_fx(cluster, "IS-HIGH-LOW-BIT-ORDER", "true")
Expand Down

0 comments on commit 515eb89

Please sign in to comment.