ragflow-cli 0.21.0.dev6__tar.gz → 0.21.0.dev8__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragflow-cli
3
- Version: 0.21.0.dev6
3
+ Version: 0.21.0.dev8
4
4
  Summary: Admin Service's client of [RAGFlow](https://github.com/infiniflow/ragflow). The Admin Service provides user management and system monitoring.
5
5
  Author-email: Lynn <lynn_inf@hotmail.com>
6
6
  License: Apache License, Version 2.0
@@ -100,6 +100,7 @@ NUMBER: /[0-9]+/
100
100
  %ignore WS
101
101
  """
102
102
 
103
+
103
104
  class AdminTransformer(Transformer):
104
105
 
105
106
  def start(self, items):
@@ -182,6 +183,7 @@ class AdminTransformer(Transformer):
182
183
  def meta_args(self, items):
183
184
  return items
184
185
 
186
+
185
187
  def encrypt(input_string):
186
188
  pub = '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB\n-----END PUBLIC KEY-----'
187
189
  pub_key = RSA.importKey(pub)
@@ -189,10 +191,12 @@ def encrypt(input_string):
189
191
  cipher_text = cipher.encrypt(base64.b64encode(input_string.encode('utf-8')))
190
192
  return base64.b64encode(cipher_text).decode("utf-8")
191
193
 
194
+
192
195
  def encode_to_base64(input_string):
193
196
  base64_encoded = base64.b64encode(input_string.encode('utf-8'))
194
197
  return base64_encoded.decode('utf-8')
195
198
 
199
+
196
200
  class AdminCLI(Cmd):
197
201
  def __init__(self):
198
202
  super().__init__()
@@ -209,8 +213,16 @@ class AdminCLI(Cmd):
209
213
 
210
214
  def onecmd(self, command: str) -> bool:
211
215
  try:
212
- print(f"command: {command}")
216
+ # print(f"command: {command}")
213
217
  result = self.parse_command(command)
218
+
219
+ # if 'type' in result and result.get('type') == 'empty':
220
+ # return False
221
+
222
+ if isinstance(result, dict):
223
+ if 'type' in result and result.get('type') == 'empty':
224
+ return False
225
+
214
226
  self.execute_command(result)
215
227
 
216
228
  if isinstance(result, Tree):
@@ -329,9 +341,9 @@ class AdminCLI(Cmd):
329
341
  row = "|"
330
342
  for col in columns:
331
343
  value = str(item.get(col, ''))
332
- if len(value) > col_widths[col]:
344
+ if get_string_width(value) > col_widths[col]:
333
345
  value = value[:col_widths[col] - 3] + "..."
334
- row += f" {value:<{col_widths[col]}} |"
346
+ row += f" {value:<{col_widths[col] - (get_string_width(value) - len(value))}} |"
335
347
  print(row)
336
348
 
337
349
  print(separator)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ragflow-cli"
3
- version = "0.21.0.dev6"
3
+ version = "0.21.0.dev8"
4
4
  description = "Admin Service's client of [RAGFlow](https://github.com/infiniflow/ragflow). The Admin Service provides user management and system monitoring. "
5
5
  authors = [{ name = "Lynn", email = "lynn_inf@hotmail.com" }]
6
6
  license = { text = "Apache License, Version 2.0" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragflow-cli
3
- Version: 0.21.0.dev6
3
+ Version: 0.21.0.dev8
4
4
  Summary: Admin Service's client of [RAGFlow](https://github.com/infiniflow/ragflow). The Admin Service provides user management and system monitoring.
5
5
  Author-email: Lynn <lynn_inf@hotmail.com>
6
6
  License: Apache License, Version 2.0