Python script not processing files

The above braces (dictionary data type) and brackets (a list data type) are all, as you can see, empty. It seems the genorate report function only acts upon the data that is supposed to be within these braces. But what stumps me is that there is absolutely nothing in these braces and there never will be. Thus the generateReport function always returns an empty string no matter what file the script reads!

It looks like the assignments are just placeholders to be filled in later. IOW equivalent to bool myfunc { return true } in C++
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
MilesAhead said:
It looks like the assignments are just placeholders to be filled in later.
That's what one would think at initial glance and is what should happen. But by the looks of things they never do get 'filled' in.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
I have been doing some research to try to figure this out. I have found:
According to this link:
https://docs.python.org/2/library/string.html
Format strings contain “replacement fields” surrounded by curly braces {}. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output.

So it appears to me the code:
Code:
Lines 831 - 837 read: 

Code:
---------
        stats = {}
        spammers = []
        unknowns = {}
        blacklists = {}
        spamtraps = {}
        contentRejections = {}
        relayRejections = {}
Will be replaced with text. That will be where the problem is. It's not being replaced.

I really don't know enough about reading Python code but does it look like the first section called "Stats" is filled in at:
Code:
Line starting at 490

    def statistics(self, stats) :
        """Add statistics for this transaction to the given stats"""

        if self.messageSent :
            stats["SMTP"] = stats.get("SMTP", 0) + 1
            if self.messageSent :
                stats["SMTP-Bytes"] = stats.get("SMTP-Bytes", 0) + self.bytesSent
            stats["OutRecip"] = stats.get("OutRecip", 0) + len(self.recipients)

        return stats
If that's true does the script go to that code?

Thanks,

Docfxit
 

My Computer My Computer

Computer type
PC/Desktop
OS
Win 7 Ultimate x32, x64, Win 7 Pro x32, x64 Win 7 Home x64, XP Pro sp3
Lines 831 to 837 are not examples of string formatting. The braces here detonate Python dictionaries whereas the pair brackets are a Python list. While some string formatting practises (i.e. the format method of strings) use braces, the braces mean something very different in this context.

If that's true does the script go to that code?
As it appears, this function never even gets called.


I'd advise you contact the developer of this script for help or get advice from a proper Python scripting forum.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Do you know of any proper Python scripting forums?

Thank you very much for your time looking into this.

Docfxit
 

My Computer My Computer

Computer type
PC/Desktop
OS
Win 7 Ultimate x32, x64, Win 7 Pro x32, x64 Win 7 Home x64, XP Pro sp3
Do you know of any proper Python scripting forums?

Thank you very much for your time looking into this.

Docfxit

The link I provided is to the Python.org page which has links to forums for Python programming as you might expect. A good free implementation of Python for Windows is available from ActiveState. The Community Eddition is free and comes in either 2.x or 3.x versions.
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
MilesAhead said:
It looks like the assignments are just placeholders to be filled in later.
That's what one would think at initial glance and is what should happen. But by the looks of things they never do get 'filled' in.

That's why I called it a placeholder. ;)
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
have you resolved the problem?
 

My Computer My Computer

Computer type
PC/Desktop
OS
windows7
Could you please post the Python script if you have resolved the problem ? i really need it to parse logs from communigate server
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
OS
windows7
Back
Top