xlwings-utils 25.0.0.post5__py3-none-any.whl → 25.0.1__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.
- xlwings_utils/xlwings_utils.py +35 -9
- {xlwings_utils-25.0.0.post5.dist-info → xlwings_utils-25.0.1.dist-info}/METADATA +3 -1
- xlwings_utils-25.0.1.dist-info/RECORD +6 -0
- xlwings_utils-25.0.0.post5.dist-info/RECORD +0 -6
- {xlwings_utils-25.0.0.post5.dist-info → xlwings_utils-25.0.1.dist-info}/WHEEL +0 -0
- {xlwings_utils-25.0.0.post5.dist-info → xlwings_utils-25.0.1.dist-info}/top_level.txt +0 -0
xlwings_utils/xlwings_utils.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# /_/\_\|_| \_/\_/ |_||_| |_| \__, ||___/ _____ \__,_| \__||_||_||___/
|
|
6
6
|
# |___/ |_____|
|
|
7
7
|
|
|
8
|
-
__version__ = "25.0.
|
|
8
|
+
__version__ = "25.0.1"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import dropbox
|
|
@@ -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
|
"""
|
|
@@ -642,25 +646,47 @@ class Capture:
|
|
|
642
646
|
|
|
643
647
|
Parameters
|
|
644
648
|
----------
|
|
649
|
+
enabled : bool
|
|
650
|
+
if True (default), all stdout output is captured
|
|
651
|
+
|
|
652
|
+
if False, stdout output is printed
|
|
653
|
+
|
|
645
654
|
include_print : bool
|
|
646
|
-
if
|
|
655
|
+
if False (default), nothing will be printed if enabled is True
|
|
647
656
|
|
|
648
|
-
if
|
|
657
|
+
if True, output will be printed (and captured if enabled is True)
|
|
649
658
|
|
|
650
659
|
Note
|
|
651
660
|
----
|
|
652
|
-
Use this function
|
|
661
|
+
Use this function, like ::
|
|
653
662
|
|
|
654
|
-
|
|
663
|
+
capture = xwu.Capture():
|
|
655
664
|
...
|
|
656
665
|
"""
|
|
657
666
|
|
|
658
|
-
|
|
667
|
+
_instance = None
|
|
668
|
+
|
|
669
|
+
def __new__(cls, *args, **kwargs):
|
|
670
|
+
# singleton
|
|
671
|
+
if cls._instance is None:
|
|
672
|
+
cls._instance = super(Capture, cls).__new__(cls)
|
|
673
|
+
return cls._instance
|
|
674
|
+
|
|
675
|
+
def __init__(self, enabled=None, include_print=None):
|
|
676
|
+
if hasattr(self, "stdout"):
|
|
677
|
+
if enabled is not None:
|
|
678
|
+
self.enabled = enabled
|
|
679
|
+
if include_print is not None:
|
|
680
|
+
self.include_print = include_print
|
|
681
|
+
return
|
|
659
682
|
self.stdout = sys.stdout
|
|
660
|
-
self._include_print = include_print
|
|
661
|
-
self.enabled=enabled
|
|
662
683
|
self._buffer = []
|
|
684
|
+
self.enabled = True if enabled is None else enabled
|
|
685
|
+
self.include_print = False if include_print is None else include_print
|
|
663
686
|
|
|
687
|
+
def __call__(self, enabled=None, include_print=None):
|
|
688
|
+
return self.__class__(enabled, include_print)
|
|
689
|
+
|
|
664
690
|
def __enter__(self):
|
|
665
691
|
self.enabled = True
|
|
666
692
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xlwings_utils
|
|
3
|
-
Version: 25.0.
|
|
3
|
+
Version: 25.0.1
|
|
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=8_OKnH-UnvOZnybavnC4CEWAR27IiqfTGyezWja-s-o,21809
|
|
3
|
+
xlwings_utils-25.0.1.dist-info/METADATA,sha256=G6E8CscnLZ6zinaPdl1XbSBQuDZcKfMi3AwdSVppb0k,9791
|
|
4
|
+
xlwings_utils-25.0.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
5
|
+
xlwings_utils-25.0.1.dist-info/top_level.txt,sha256=kf5SEv0gZiRObPhUoYcc1O_iX_wwTOPeUIYvzyYeAM4,14
|
|
6
|
+
xlwings_utils-25.0.1.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
xlwings_utils/__init__.py,sha256=FdaRztevSu5akGL7KBUBRzqwLMRTdvVUuS2Kfp2f1Uc,68
|
|
2
|
-
xlwings_utils/xlwings_utils.py,sha256=X_EAhFGojjiAUIia11YhMu8B7H6NXKRUtINN20cI2x4,20961
|
|
3
|
-
xlwings_utils-25.0.0.post5.dist-info/METADATA,sha256=7uEqHmrhgVwHhfB3ZoDNbMR-7UEk9jCHBIg1_xmxf_k,9713
|
|
4
|
-
xlwings_utils-25.0.0.post5.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
5
|
-
xlwings_utils-25.0.0.post5.dist-info/top_level.txt,sha256=kf5SEv0gZiRObPhUoYcc1O_iX_wwTOPeUIYvzyYeAM4,14
|
|
6
|
-
xlwings_utils-25.0.0.post5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|