xlwings-utils 25.0.0.post4__py3-none-any.whl → 25.0.0.post6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xlwings-utils might be problematic. Click here for more details.

@@ -16,7 +16,11 @@ import math
16
16
 
17
17
  dbx = None
18
18
  Pythonista = sys.platform == "ios"
19
-
19
+ try:
20
+ import xlwings
21
+ xlwings = True
22
+ except ImportError:
23
+ xlwings=False
20
24
 
21
25
  def dropbox_init(refresh_token=None, app_key=None, app_secret=None):
22
26
  """
@@ -655,11 +659,29 @@ class Capture:
655
659
  ...
656
660
  """
657
661
 
658
- def __init__(self):
662
+ _instance = None
663
+
664
+ def __new__(cls, *args, **kwargs):
665
+ # singleton
666
+ if cls._instance is None:
667
+ cls._instance = super(Capture, cls).__new__(cls)
668
+ return cls._instance
669
+
670
+ def __init__(self, enabled=None, include_print=None):
671
+ if hasattr(self, "stdout"):
672
+ if enabled is not None:
673
+ self.enabled = enabled
674
+ if include_print is not None:
675
+ self.include_print = include_print
676
+ return
659
677
  self.stdout = sys.stdout
660
- self._include_print = False
661
678
  self._buffer = []
679
+ self.enabled = True if enabled is None else enabled
680
+ self.include_print = False if include_print is None else include_print
662
681
 
682
+ def __call__(self, enabled=None, include_print=None):
683
+ return self.__class__(enabled, include_print)
684
+
663
685
  def __enter__(self):
664
686
  self.enabled = True
665
687
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xlwings_utils
3
- Version: 25.0.0.post4
3
+ Version: 25.0.0.post6
4
4
  Summary: xlwings_utils
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/xlwings_utils
@@ -40,6 +40,8 @@ import xlwings_utils as xwu
40
40
 
41
41
  at the top of a xlwings lite script.
42
42
 
43
+ If an application runs under xlwings, `xwu.xlwings` will be True. False, if not.
44
+
43
45
  ## Dropbox support
44
46
 
45
47
  The xlwings lite system does not provide access to the local file system. With this module, files can be copied between Dropbox and the local pyodide file system, making it possible to indirectly use the local file system.
@@ -0,0 +1,6 @@
1
+ xlwings_utils/__init__.py,sha256=FdaRztevSu5akGL7KBUBRzqwLMRTdvVUuS2Kfp2f1Uc,68
2
+ xlwings_utils/xlwings_utils.py,sha256=wUaw5KwM3KnKTegSHNqVrXKIIAEtTEIdsyFAjfhJDUo,21652
3
+ xlwings_utils-25.0.0.post6.dist-info/METADATA,sha256=kr3GwdUxMr6ULmz7nXkjyOej_O3vrraRPbowYdoBDJQ,9797
4
+ xlwings_utils-25.0.0.post6.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
5
+ xlwings_utils-25.0.0.post6.dist-info/top_level.txt,sha256=kf5SEv0gZiRObPhUoYcc1O_iX_wwTOPeUIYvzyYeAM4,14
6
+ xlwings_utils-25.0.0.post6.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- xlwings_utils/__init__.py,sha256=FdaRztevSu5akGL7KBUBRzqwLMRTdvVUuS2Kfp2f1Uc,68
2
- xlwings_utils/xlwings_utils.py,sha256=j0FNzIJ1eu56uk1m3T739pslbl-gL8duZY0oofXzaC4,20889
3
- xlwings_utils-25.0.0.post4.dist-info/METADATA,sha256=IhzzvU8yc2eO58cjjgM-nngwqCFXl77TabmB2Mmttxc,9713
4
- xlwings_utils-25.0.0.post4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
5
- xlwings_utils-25.0.0.post4.dist-info/top_level.txt,sha256=kf5SEv0gZiRObPhUoYcc1O_iX_wwTOPeUIYvzyYeAM4,14
6
- xlwings_utils-25.0.0.post4.dist-info/RECORD,,