Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create msg preprocessor #269

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

tofu-rocketry
Copy link
Member

Resolves #74

Create a preprocessor that reads messages from a queue and combines
the ones that have the same header (and are next to each other in the
queue) into a single message. The combined messages are added to a new
queue (which is then used for sending them).
Messages read from a queue (queuesimple) are generally in bytes,
even when added as strings to the queue. For sender and receiver
to work, the messages need to be converted to strings after they are
read from the queue.

for dirpath, dirnames, files in os.walk(qpath):
dirs_at_path = dirnames
files_at_path = files

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable files_at_path is not used.
for dirpath, dirnames, files in os.walk(qpath):
dirs_at_path = dirnames
files_at_path = files
path_examined = qpath

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable path_examined is not used.
try:
text = text.decode()
originally_a_string = False
except (UnicodeDecodeError, AttributeError):

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.


def _first_time_executing_code(previous_header):
if previous_header == None:

Check notice

Code scanning / CodeQL

Testing equality to None Note

Testing for None should use the 'is' operator.

from __future__ import print_function

import ssm.agents

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'ssm' is not used.
from __future__ import print_function

import ssm.agents
from ssm import __version__, LOG_BREAK

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'LOG_BREAK' is not used.
import ssm.agents
from ssm import __version__, LOG_BREAK
import os
import logging

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'logging' is not used.
from ssm import __version__, LOG_BREAK
import os
import logging
from optparse import OptionParser

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'OptionParser' is not used.
raise ImportError('Dirq path_type requested but'
'dirq module not found.')

if (len(dirs_at_path) == 0 or

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'dirs_at_path' may be used before it is initialized.
outq = QueueSimple(qpath)

elif path_type == 'directory':
if len(dirs_at_path) > 0:

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'dirs_at_path' may be used before it is initialized.
@tofu-rocketry tofu-rocketry added this to the 3.5.0 milestone Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Create message pre-processor for split/join
2 participants