<s> from __pyjamas__ import get_main_frame , doc , JS <EOL> sNextHashId = <NUM_LIT:0> <EOL> def getNextHashId ( ) : <EOL> global sNextHashId <EOL> sNextHashId += <NUM_LIT:1> <EOL> return sNextHashId <EOL> def getHashCode ( o ) : <EOL> JS ( """<STR_LIT>""" ) <EOL> def getModuleName ( ) : <EOL> import os <EOL> import sys <EOL> mod_name = sys . argv [ <NUM_LIT:0> ] <EOL> mod_name = os . path . split ( mod_name ) [ <NUM_LIT:1> ] <EOL> mod_name = os . path . spliext ( mod_name ) [ <NUM_LIT:0> ] <EOL> return mod_name <EOL> def getModuleBaseURL ( ) : <EOL> s = get_main_frame ( ) . getUri ( ) <EOL> i = s . find ( '<STR_LIT:#>' ) <EOL> if i != - <NUM_LIT:1> : <EOL> s = s [ : i ] <EOL> i = s . find ( '<STR_LIT:?>' ) <EOL> if i != - <NUM_LIT:1> : <EOL> s = s [ : i ] <EOL> i = s . rfind ( '<STR_LIT:/>' ) <EOL> if i != - <NUM_LIT:1> : <EOL> s = s [ : i ] <EOL> if len ( s ) > <NUM_LIT:0> : <EOL> return s + "<STR_LIT:/>" <EOL> return "<STR_LIT>" </s>
