Beispiel #1
0
 def __init__(self, xmsf, document):
     self.formatSupplier = document
     formatSettings = self.formatSupplier.getNumberFormatSettings()
     date = formatSettings.NullDate
     self.calendar = dateTimeObject(date.Year, date.Month, date.Day)
     self.formatter = NumberFormatter.createNumberFormatter(xmsf,
         self.formatSupplier)
Beispiel #2
0
    def setWizardTemplateDocInfo(self, WizardName, TemplateDescription):
        try:
            xNA = Configuration.getConfigurationRoot(
                self.xMSF, "/org.openoffice.UserProfile/Data", False)
            gn = xNA.getByName("givenname")
            sn = xNA.getByName("sn")
            fullname = str(gn) + " " + str(sn)
            now = time.localtime(time.time())
            year = time.strftime("%Y", now)
            month = time.strftime("%m", now)
            day = time.strftime("%d", now)

            dateObject = dateTimeObject(int(year), int(month), int(day))
            du = self.DateUtils(self.xMSF, self.xTextDocument)
            ff = du.getFormat(DATE_SYS_DDMMYY)
            myDate = du.format(ff, dateObject)
            xDocProps2 = self.xTextDocument.DocumentProperties
            xDocProps2.Author = fullname
            xDocProps2.ModifiedBy = fullname
            description = xDocProps2.Description
            description = description + " " + TemplateDescription
            description = description.replace("<wizard_name>", WizardName)
            description = description.replace("<current_date>", myDate)
            xDocProps2.Description = description
        except Exception:
            traceback.print_exc()
 def format(self, formatIndex, date):
     dateTime = dateTimeObject(date.Year, date.Month, date.Day)
     difference =  dateTime - self.calendar
     return self.formatter.convertNumberToString(formatIndex,  difference.days)
Beispiel #4
0
 def format(self, formatIndex, date):
     dateTime = dateTimeObject(date.Year, date.Month, date.Day)
     difference = dateTime - self.calendar
     return self.formatter.convertNumberToString(
         formatIndex, difference.days)