[Python] I cant read Python!
5 answers - 944 bytes -

from com.pplus.workflow.server import WFSystem
from com.pplus.util import SystemLog, PropertiesUtils
from com.pplus.db import DBUtils
import java
SystemLog.logMessage( 'DumpPublicHolidays extension - dumping public holidays to database table', SystemLog.ADVICE )
db = WFSystem.getDatabase( dbName )
conn, stmt = None, None
try:
conn = db.getConnection()
# clear the table
stmt = conn.createStatement()
stmt.executeUpdate( deleteSQL )
# now need to parse the holiday details from the system props (since the business calendar isn't accessible)
props = WFSystem.getProperties()
holProps = PropertiesUtils.getSubSections( props, 'calendar.holiday' )
...
...
There is more to this code but what is 'calendar.holiday' and where can I find this file!!!?
Any clues would be appreciated!
No.1 | | 316 bytes |
| 
Hmmm...is there ' ' around calendar.holiday? Wouldn't that imply that it is a string?
I have never heard about any module called calendar.holiday, even looked it up in my two python books. Nothing...So if it actualy is a module, then it is probably (not 100% sure) home made..:)
- -
No.2 | | 378 bytes |
| 
I've determined it is a section within a text file - much like a section within an INI file [section]. I can't work out where this file is. I don't know what/where WFSystem is.
It seems to be imported from com.pplus.workflow.server, like it's a class or something. My python knowledge is zero so I'm not making much progress with this one.
No.3 | | 489 bytes |
| 
I know a bit about it. But it is more or less impossible for me to find out since the modules you are refering to is not standard Python modules. If they where I could have had a look at it. But WFSystem.getProperties and PropertiesUtils.getSubSections is two functions that probably some of your co workers have once made, or you have bought from an other company. So it is impossible for me to tell you what they do.
you can always have a look inside them though.
- -
No.4 | | 122 bytes |
| 
Where can I find these modules? Can you tell from the code or is there a 'standard' place to find these things?
No.5 | | 236 bytes |
| 
There should be an "import" statement in the top of your code. That should tell you where it is. But be aware, Python programmers often like to have all their classes in the same file, so it might even be in the same file.
- -