Skip to content

Commit

Permalink
python client reconnection logic fixeed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobeeeef committed Sep 10, 2024
1 parent 7d8398a commit 89d7bed
Show file tree
Hide file tree
Showing 9 changed files with 459 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .idea/artifacts/XTABLES_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/main/python/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions src/main/python/.idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/main/python/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/main/python/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/python/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions src/main/python/Utilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
def validate_key(key, throw_error):
# Check if the key is null or empty
if key is None:
if throw_error:
raise ValueError("Key cannot be null.")
else:
return False

# Check if key contains spaces
if " " in key:
if throw_error:
raise ValueError("Key cannot contain spaces.")
else:
return False

# Check if key starts or ends with '.'
if key.startswith(".") or key.endswith("."):
if throw_error:
raise ValueError("Key cannot start or end with '.'")
else:
return False

# Check if key contains multiple consecutive '.'
if ".." in key:
if throw_error:
raise ValueError("Key cannot contain multiple consecutive '.'")
else:
return False

# Check if each part of the key separated by '.' is empty
if key:
parts = key.split(".")
for part in parts:
if not part:
if throw_error:
raise ValueError("Key contains empty part(s).")
else:
return False

return True


def validate_name(name, throw_error):
# Check if the name is null or empty
if name is None:
if throw_error:
raise ValueError("Name cannot be null.")
else:
return False

# Check if the name contains spaces
if " " in name:
if throw_error:
raise ValueError("Name cannot contain spaces.")
else:
return False

# Check if the name contains '.'
if "." in name:
if throw_error:
raise ValueError("Name cannot contain '.'")
else:
return False

return True
Loading

0 comments on commit 89d7bed

Please sign in to comment.