peek-python 1.8.1__tar.gz → 1.8.3__tar.gz

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.
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: peek-python
3
- Version: 1.8.1
3
+ Version: 1.8.3
4
4
  Summary: peek - debugging and benchmarking made easy
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
- Project-URL: Homepage, https://github.com/salabim/ycecream
7
- Project-URL: Repository, https://github.com/salabim/ycecream
6
+ Project-URL: Homepage, https://github.com/salabim/peek
7
+ Project-URL: Repository, https://github.com/salabim/peek
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -1099,9 +1099,34 @@ Examples:
1099
1099
  This will print one line with`1` only.
1100
1100
 
1101
1101
  # Copying to the clipboard
1102
- It is possible to copy a value to the clipbaord with the method `to_clipboard` which accepts a value to be copied to the clipboard.
1103
- So,
1102
+ It is possible to copy a value to the clipboard. There are two ways:
1104
1103
 
1104
+ ### With peek(*args, to_clipboard=True)
1105
+
1106
+ With the optional keyword argument, *to_clipboard*:
1107
+
1108
+ - If to_clipboard==False (the default), nothing is copied to the clipboard.
1109
+ - If to_clipboard==True, the *value* of the the *first* parameter will be copied to the clipboard. The output itself is as usual.
1110
+
1111
+ Examples:
1112
+
1113
+ ```
1114
+ part1 = 200
1115
+ extra = "extra"
1116
+ peek(part1, extra, to_clipboard=True)
1117
+ # will print part1=200, extra='extra' and copy 200 to the clipboard
1118
+ peek(200, to_clipboard=True)\
1119
+ # will print 200 and copy 200 to the clipboard
1120
+ peek(to_clipboard=True)
1121
+ # will print #5 (or similar) and empty the clipboard
1122
+ ```
1123
+
1124
+ Note that *to_clipboard* is not a peek attribute and can only be used when calling `peek`,
1125
+ If as_str==True, to_clipboard is ignored.
1126
+
1127
+ ### With peek.to_clipboard
1128
+
1129
+ Just use peek.to_clipboard to copy any value to the clipboard. So,
1105
1130
  ```
1106
1131
  part1 = 1234
1107
1132
  peek.to_clipboard(part1)
@@ -1114,7 +1139,9 @@ If the confirmation message is not wanted, just add confirm=False, like
1114
1139
  peek.to_clipboard(part1, confirm=False)
1115
1140
  ```
1116
1141
 
1117
- Implementation detail: this functionality uses pyperclip, apart from under Pythonista, whre the
1142
+ ### General
1143
+
1144
+ Implementation detail: the clipboard functionality uses pyperclip, apart from under Pythonista, where the
1118
1145
  builtin clipboard module is used.
1119
1146
 
1120
1147
  This functionality is particularly useful for entering an answer of an *Advent of Code* solution to the site.
@@ -1079,9 +1079,34 @@ Examples:
1079
1079
  This will print one line with`1` only.
1080
1080
 
1081
1081
  # Copying to the clipboard
1082
- It is possible to copy a value to the clipbaord with the method `to_clipboard` which accepts a value to be copied to the clipboard.
1083
- So,
1082
+ It is possible to copy a value to the clipboard. There are two ways:
1084
1083
 
1084
+ ### With peek(*args, to_clipboard=True)
1085
+
1086
+ With the optional keyword argument, *to_clipboard*:
1087
+
1088
+ - If to_clipboard==False (the default), nothing is copied to the clipboard.
1089
+ - If to_clipboard==True, the *value* of the the *first* parameter will be copied to the clipboard. The output itself is as usual.
1090
+
1091
+ Examples:
1092
+
1093
+ ```
1094
+ part1 = 200
1095
+ extra = "extra"
1096
+ peek(part1, extra, to_clipboard=True)
1097
+ # will print part1=200, extra='extra' and copy 200 to the clipboard
1098
+ peek(200, to_clipboard=True)\
1099
+ # will print 200 and copy 200 to the clipboard
1100
+ peek(to_clipboard=True)
1101
+ # will print #5 (or similar) and empty the clipboard
1102
+ ```
1103
+
1104
+ Note that *to_clipboard* is not a peek attribute and can only be used when calling `peek`,
1105
+ If as_str==True, to_clipboard is ignored.
1106
+
1107
+ ### With peek.to_clipboard
1108
+
1109
+ Just use peek.to_clipboard to copy any value to the clipboard. So,
1085
1110
  ```
1086
1111
  part1 = 1234
1087
1112
  peek.to_clipboard(part1)
@@ -1094,7 +1119,9 @@ If the confirmation message is not wanted, just add confirm=False, like
1094
1119
  peek.to_clipboard(part1, confirm=False)
1095
1120
  ```
1096
1121
 
1097
- Implementation detail: this functionality uses pyperclip, apart from under Pythonista, whre the
1122
+ ### General
1123
+
1124
+ Implementation detail: the clipboard functionality uses pyperclip, apart from under Pythonista, where the
1098
1125
  builtin clipboard module is used.
1099
1126
 
1100
1127
  This functionality is particularly useful for entering an answer of an *Advent of Code* solution to the site.
@@ -4,7 +4,7 @@
4
4
  # | .__/ \___| \___||_|\_\
5
5
  # |_| like print, but easy.
6
6
 
7
- __version__ = "1.8.1"
7
+ __version__ = "1.8.3"
8
8
 
9
9
  """
10
10
  See https://github.com/salabim/peek for details
@@ -520,6 +520,7 @@ class _Peek:
520
520
  level = kwargs.pop("level", nv)
521
521
  enforce_line_length = kwargs.pop("enforce_line_length", nv)
522
522
  delta = kwargs.pop("delta", nv)
523
+ to_clipboard=kwargs.pop("to_clipboard", nv)
523
524
  as_str = kwargs.pop("as_str", nv)
524
525
  provided = kwargs.pop("provided", nv)
525
526
  pr = kwargs.pop("pr", nv)
@@ -528,6 +529,7 @@ class _Peek:
528
529
  raise TypeError("can't use both pr and provided")
529
530
 
530
531
  as_str = False if as_str is nv else bool(as_str)
532
+ to_clipboard=False if to_clipboard is nv else bool(to_clipboard)
531
533
  provided = True if provided is nv else bool(provided)
532
534
 
533
535
  this = self.fork()
@@ -776,6 +778,7 @@ class _Peek:
776
778
  return out + "\n"
777
779
  else:
778
780
  return ""
781
+ peek.to_clipboard(pairs[0].right if "pairs" in locals() else '',confirm=False)
779
782
  this.do_output(out)
780
783
 
781
784
  return return_args(args, this.return_none)
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: peek-python
3
- Version: 1.8.1
3
+ Version: 1.8.3
4
4
  Summary: peek - debugging and benchmarking made easy
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
- Project-URL: Homepage, https://github.com/salabim/ycecream
7
- Project-URL: Repository, https://github.com/salabim/ycecream
6
+ Project-URL: Homepage, https://github.com/salabim/peek
7
+ Project-URL: Repository, https://github.com/salabim/peek
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -1099,9 +1099,34 @@ Examples:
1099
1099
  This will print one line with`1` only.
1100
1100
 
1101
1101
  # Copying to the clipboard
1102
- It is possible to copy a value to the clipbaord with the method `to_clipboard` which accepts a value to be copied to the clipboard.
1103
- So,
1102
+ It is possible to copy a value to the clipboard. There are two ways:
1104
1103
 
1104
+ ### With peek(*args, to_clipboard=True)
1105
+
1106
+ With the optional keyword argument, *to_clipboard*:
1107
+
1108
+ - If to_clipboard==False (the default), nothing is copied to the clipboard.
1109
+ - If to_clipboard==True, the *value* of the the *first* parameter will be copied to the clipboard. The output itself is as usual.
1110
+
1111
+ Examples:
1112
+
1113
+ ```
1114
+ part1 = 200
1115
+ extra = "extra"
1116
+ peek(part1, extra, to_clipboard=True)
1117
+ # will print part1=200, extra='extra' and copy 200 to the clipboard
1118
+ peek(200, to_clipboard=True)\
1119
+ # will print 200 and copy 200 to the clipboard
1120
+ peek(to_clipboard=True)
1121
+ # will print #5 (or similar) and empty the clipboard
1122
+ ```
1123
+
1124
+ Note that *to_clipboard* is not a peek attribute and can only be used when calling `peek`,
1125
+ If as_str==True, to_clipboard is ignored.
1126
+
1127
+ ### With peek.to_clipboard
1128
+
1129
+ Just use peek.to_clipboard to copy any value to the clipboard. So,
1105
1130
  ```
1106
1131
  part1 = 1234
1107
1132
  peek.to_clipboard(part1)
@@ -1114,7 +1139,9 @@ If the confirmation message is not wanted, just add confirm=False, like
1114
1139
  peek.to_clipboard(part1, confirm=False)
1115
1140
  ```
1116
1141
 
1117
- Implementation detail: this functionality uses pyperclip, apart from under Pythonista, whre the
1142
+ ### General
1143
+
1144
+ Implementation detail: the clipboard functionality uses pyperclip, apart from under Pythonista, where the
1118
1145
  builtin clipboard module is used.
1119
1146
 
1120
1147
  This functionality is particularly useful for entering an answer of an *Advent of Code* solution to the site.
@@ -8,7 +8,7 @@ authors = [
8
8
  {name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com"}
9
9
  ]
10
10
  description = "peek - debugging and benchmarking made easy"
11
- version = "1.8.1"
11
+ version = "1.8.3"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.6"
14
14
  dependencies = ["colorama","six","executing","asttokens","tomli","pyperclip"]
@@ -19,9 +19,8 @@ classifiers = [
19
19
  "Programming Language :: Python :: 3 :: Only"
20
20
  ]
21
21
  [project.urls]
22
- Homepage = "https://github.com/salabim/ycecream"
23
- Repository = "https://github.com/salabim/ycecream"
24
-
22
+ Homepage = "https://github.com/salabim/peek"
23
+ Repository = "https://github.com/salabim/peek"
25
24
 
26
25
  [tool.setuptools]
27
26
  packages = ["peek"]
File without changes
File without changes