PDA

Click to See Complete Forum and Search --> : [Python] I can't read Python!!!


Foxer
Jul 25th, 2005, 01:18 AM
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!

NoteMe
Jul 26th, 2005, 05:39 AM
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..:)




- ии -

Foxer
Jul 27th, 2005, 12:34 AM
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.

NoteMe
Jul 27th, 2005, 06:09 AM
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.


- ии -

Foxer
Jul 28th, 2005, 01:19 AM
Where can I find these modules? Can you tell from the code or is there a 'standard' place to find these things?

NoteMe
Jul 28th, 2005, 03:28 AM
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.


- ии -