Skip to content

Commit 32e10b1

Browse files
committed
Minor simplifications
1 parent bd23241 commit 32e10b1

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

itables/javascript.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import uuid
77
import warnings
88
from base64 import b64encode
9-
from copy import deepcopy
109
from pathlib import Path
1110

1211
import numpy as np
@@ -475,7 +474,7 @@ def set_default_options(kwargs, use_to_html):
475474
and not option.startswith("__")
476475
and option not in {"dt_bundle", "find_package_file", "UNPKG_DT_BUNDLE_URL"}
477476
):
478-
kwargs[option] = deepcopy(getattr(opt, option))
477+
kwargs[option] = getattr(opt, option)
479478

480479
for name, value in kwargs.items():
481480
if value is None:
@@ -598,7 +597,11 @@ def html_table_from_template(
598597
connected_import = (
599598
"import {DataTable, jQuery as $} from '" + UNPKG_DT_BUNDLE_URL + "';"
600599
)
601-
local_import = "const { DataTable, jQuery: $ } = await import(window._datatables_src_for_itables);"
600+
local_import = (
601+
"const { DataTable, jQuery: $ } = await import(window."
602+
+ DATATABLES_SRC_FOR_ITABLES
603+
+ ");"
604+
)
602605
output = replace_value(output, connected_import, local_import)
603606

604607
output = replace_value(
@@ -607,10 +610,6 @@ def html_table_from_template(
607610
html_table,
608611
)
609612
output = replace_value(output, "#table_id", "#{}".format(table_id))
610-
if not connected:
611-
output = replace_value(
612-
output, "_datatables_src_for_itables", DATATABLES_SRC_FOR_ITABLES
613-
)
614613

615614
if column_filters:
616615
# If the below was false, we would need to concatenate the JS code

itables/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""ITables' version number"""
22

3-
__version__ = "2.0.0rc5"
3+
__version__ = "2.0.0rc6"

0 commit comments

Comments
 (0)