streamdown 0.24.0__py3-none-any.whl → 0.25.0__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.
streamdown/sd.py CHANGED
@@ -104,19 +104,22 @@ visible_length = lambda x: len(visible(x)) + dbl_count(x)
104
104
  extract_ansi_codes = lambda text: re.findall(ESCAPE, text)
105
105
  remove_ansi = lambda line, codeList: reduce(lambda line, code: line.replace(code, ''), codeList, line)
106
106
 
107
+ def gettmpdir():
108
+ tmp_dir_all = os.path.join(tempfile.gettempdir(), "sd")
109
+ os.makedirs(tmp_dir_all, mode=0o777, exist_ok=True)
110
+ tmp_dir = os.path.join(tmp_dir_all, str(os.getuid()))
111
+ os.makedirs(tmp_dir, exist_ok=True)
112
+ return tmp_dir
113
+
107
114
  def debug_write(text):
108
115
  if state.Logging:
109
116
  if state.Logging == True:
110
- tmp_dir = os.path.join(tempfile.gettempdir(), "sd")
111
- os.makedirs(tmp_dir, exist_ok=True)
112
- state.Logging = tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="dbg", delete=False, mode="wb")
117
+ state.Logging = tempfile.NamedTemporaryFile(dir=gettmpdir(), prefix="dbg", delete=False, mode="wb")
113
118
  state.Logging.write(text)
114
119
 
115
120
  def savebrace():
116
121
  if state.Savebrace and state.code_buffer_raw:
117
- tmp_dir = os.path.join(tempfile.gettempdir(), "sd")
118
- os.makedirs(tmp_dir, exist_ok=True)
119
- path = os.path.join(tempfile.gettempdir(), "sd", 'savebrace')
122
+ path = os.path.join(gettmpdir(), 'savebrace')
120
123
  with open(path, "a") as f:
121
124
  f.write(state.code_buffer_raw + "\x00")
122
125
  f.flush()
@@ -514,7 +517,6 @@ def line_format(line):
514
517
  state.code_buffer_raw += token
515
518
 
516
519
  elif token == '~~' and (state.in_strikeout or not_text(prev_token)):
517
- print("in strike")
518
520
  state.in_strikeout = not state.in_strikeout
519
521
  result += STRIKEOUT[0] if state.in_strikeout else STRIKEOUT[1]
520
522
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamdown
3
- Version: 0.24.0
3
+ Version: 0.25.0
4
4
  Summary: A streaming markdown renderer for modern terminals with syntax highlighting
5
5
  Project-URL: Homepage, https://github.com/kristopolous/Streamdown
6
6
  Project-URL: Bug Tracker, https://github.com/kristopolous/Streamdown/issues
@@ -0,0 +1,9 @@
1
+ streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ streamdown/sd.py,sha256=ffr_xygYCNseJ_jkvie88Omiz9aaOhY32_-dDj1LdUY,42326
3
+ streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
4
+ streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
5
+ streamdown-0.25.0.dist-info/METADATA,sha256=H9-T77e6Rs7fN-lJGG07So4uxqv6utRZrN98B8lLPH4,9658
6
+ streamdown-0.25.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ streamdown-0.25.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
8
+ streamdown-0.25.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
9
+ streamdown-0.25.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- streamdown/sd.py,sha256=WH56QV5hYGKGT3rEPDuuzDk0lMEsHuLhdVtKvEdvtxE,42334
3
- streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
4
- streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
5
- streamdown-0.24.0.dist-info/METADATA,sha256=yaD-DJOsxp9opkPiVItCGGx4vz5kXG5HoL7T60WOU7E,9658
6
- streamdown-0.24.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- streamdown-0.24.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
8
- streamdown-0.24.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
9
- streamdown-0.24.0.dist-info/RECORD,,