Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
PlacelessTranslationService.GettextMessageCatalog.BrokenMessageCatalog Class Reference
Inheritance diagram for PlacelessTranslationService.GettextMessageCatalog.BrokenMessageCatalog:
Inheritance graph
[legend]
Collaboration diagram for PlacelessTranslationService.GettextMessageCatalog.BrokenMessageCatalog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getIdentifier
def getId
def getError
def Title
def get_size
def reload
def file_exists
def manage_afterAdd
def manage_beforeDelete
def manage_afterClone

Public Attributes

 id
 error

Static Public Attributes

string meta_type = 'Broken Gettext Message Catalog'
string icon = 'p_/broken'
int isPrincipiaFolderish = 0
int isTopLevelPrincipiaApplicationObject = 0
tuple security = ClassSecurityInfo()
tuple manage_options
tuple index_html = ptFile('index_html', globals(), 'www', 'catalog_broken')

Private Member Functions

def _getModTime
def _getPoFile

Private Attributes

 _pofile
 _mod_time

Detailed Description

broken message catalog 

Definition at line 60 of file GettextMessageCatalog.py.


Constructor & Destructor Documentation

Definition at line 71 of file GettextMessageCatalog.py.

00071 
00072     def __init__(self, id, pofile, error):
00073         self._pofile = make_relative_location(pofile)
00074         self.id = id
00075         self._mod_time = self._getModTime()
00076         self.error = traceback.format_exception(error[0],error[1],error[2])


Member Function Documentation

Definition at line 78 of file GettextMessageCatalog.py.

00078 
00079     def _getModTime(self):
00080         """
00081         """
00082         try:
00083             mtime = os.stat(self._getPoFile())[ST_MTIME]
00084         except (IOError, OSError):
00085             mtime = 0
00086         return mtime

Here is the call graph for this function:

Here is the caller graph for this function:

get absolute path of the po file as string

Definition at line 103 of file GettextMessageCatalog.py.

00103 
00104     def _getPoFile(self):
00105         """get absolute path of the po file as string
00106         """
00107         prefix, pofile = self._pofile
00108         if prefix == 'ZOPE_HOME':
00109             return os.path.join(ZOPE_HOME, pofile)
00110         elif prefix == 'INSTANCE_HOME':
00111             return os.path.join(INSTANCE_HOME, pofile)
00112         elif prefix == 'CLIENT_HOME':
00113             return os.path.join(CLIENT_HOME, pofile)
00114         else:
00115             return os.path.normpath(pofile)

Here is the caller graph for this function:

Definition at line 146 of file GettextMessageCatalog.py.

00146 
00147     def file_exists(self):
00148         try:
00149             file = open(self._getPoFile(), 'rb')
00150         except:
00151             return False
00152         return True

Here is the call graph for this function:

Get the size of the underlying file.

Definition at line 120 of file GettextMessageCatalog.py.

00120 
00121     def get_size(self):
00122         """Get the size of the underlying file."""
00123         return os.path.getsize(self._getPoFile())

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file GettextMessageCatalog.py.

00098 
00099     def getError(self):
00100         """
00101         """
00102         return self.error

Definition at line 92 of file GettextMessageCatalog.py.

00092 
00093     def getId(self):
00094         """
00095         """
00096         return self.id

Definition at line 87 of file GettextMessageCatalog.py.

00087 
00088     def getIdentifier(self):
00089         """
00090         """
00091         return self.id

Definition at line 153 of file GettextMessageCatalog.py.

00153 
    def manage_afterAdd(self, item, container): pass

Definition at line 155 of file GettextMessageCatalog.py.

00155 
00156     def manage_afterClone(self, item): pass

Definition at line 154 of file GettextMessageCatalog.py.

00154 
    def manage_beforeDelete(self, item, container): pass
Forcibly re-read the file 

Definition at line 124 of file GettextMessageCatalog.py.

00124 
00125     def reload(self, REQUEST=None):
00126         """ Forcibly re-read the file """
00127         # get pts
00128         pts = aq_parent(self)
00129         name = self.getId()
00130         pofile = self._getPoFile()
00131         pts._delObject(name)
00132         try: pts.addCatalog(GettextMessageCatalog(name, pofile))
00133         except OSError:
00134             # XXX TODO
00135             # remove a catalog if it cannot be loaded from the old location
00136             raise
00137         except:
00138             exc=sys.exc_info()
00139             log('Message Catalog has errors', logging.WARNING, name, exc)
00140             pts.addCatalog(BrokenMessageCatalog(name, pofile, exc))
00141         self = pts._getOb(name)
00142         if hasattr(REQUEST, 'RESPONSE'):
00143             if not REQUEST.form.has_key('noredir'):
00144                 REQUEST.RESPONSE.redirect(self.absolute_url())

Here is the caller graph for this function:

Definition at line 117 of file GettextMessageCatalog.py.

00117 
00118     def Title(self):
00119         return self.title

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 74 of file GettextMessageCatalog.py.

Definition at line 72 of file GettextMessageCatalog.py.

Definition at line 75 of file GettextMessageCatalog.py.

Definition at line 63 of file GettextMessageCatalog.py.

Definition at line 73 of file GettextMessageCatalog.py.

Definition at line 161 of file GettextMessageCatalog.py.

Definition at line 65 of file GettextMessageCatalog.py.

Definition at line 66 of file GettextMessageCatalog.py.

Initial value:
(
        {'label':'Info', 'action':''},
        )

Definition at line 157 of file GettextMessageCatalog.py.

Definition at line 62 of file GettextMessageCatalog.py.

Definition at line 68 of file GettextMessageCatalog.py.


The documentation for this class was generated from the following file: