def __init__(self, path=None):
        path = path or self.default_path
        XslWorksheet.__init__(self, entry_class=PubsState)
        self.read(path)
        self.sort()

        self.countryCodeMap = CountryCodeMap()
Beispiel #2
0
def report():
    reportbasedir = '/home/ostwald/python-lib/ncar_lib/repository/reports/lab_reports/GCD-report'

    for filename in os.listdir(reportbasedir):
        root, ext = os.path.splitext(filename)
        if ext != '.txt':
            continue
        src = os.path.join(reportbasedir, filename)

        xls = XslWorksheet()
        xls.read(src)
        print "%s - %d" % (root, len(xls))
    def getLdapUserMapping(self):
        """
		consult a mapping table
		"""
        from xls import XslWorksheet, WorksheetEntry
        table = XslWorksheet()
        table.read(nsdlToLdap_Globals.USERNAME_XLS)
        mapping = {}
        for rec in table:
            username = rec['username']
            # print "%s (%s)" % (username, rec['ldap acccount'])
            if username in mapping.keys():
                raise KeyError, "duplicate entry for '%s'" % username
            mapping[username] = rec['ldap acccount']
        return mapping
Beispiel #4
0
def compare():
    # reportbasedir = '/Users/ostwald/devel/python-lib/ncar_lib/repository/reports/lab_reports/reports'
    reportbasedir = '/home/ostwald/python-lib/ncar_lib/repository/reports/lab_reports/GCD-report'

    for filename in os.listdir(reportbasedir):
        root, ext = os.path.splitext(filename)
        if ext != '.txt':
            continue
        src = os.path.join(reportbasedir, filename)
        src_v1 = os.path.join(
            os.path.join(os.path.dirname(reportbasedir), 'GCD-report-5-2',
                         filename))
        try:
            xls = XslWorksheet()
            xls.read(src)
            xls_v1 = XslWorksheet()
            xls_v1.read(src_v1)
            print "%s: xls: %d, xls_v1: %d" % (root, len(xls), len(xls_v1))
        except:
            print sys.exc_info()[1]
Beispiel #5
0
 def __init__(self, path):
     XslWorksheet.__init__(self, entry_class=EsslPersonEntry)
     self.read(path)
Beispiel #6
0
	def __init__ (self, path):
		XslWorksheet.__init__ (self, entry_class=SourceXlsRecord)
		self.read (path)
		self.lookup = UserDict()
		for item in self:
			self.lookup[item.source] = item.pubname
Beispiel #7
0
 def __init__(self, path):
     XslWorksheet.__init__(self, entry_class=WosXlsRecord)
     self.read(path)
Beispiel #8
0
	def __init__ (self):
		XslWorksheet.__init__ (self)
		self.read (data)
 def write(self, path=None):
     if path is None:
         path = self.path
     XslWorksheet.write(self, path)
Beispiel #10
0
	def __init__ (self, path):
		XslWorksheet.__init__ (self, entry_class=AuthorEntry)
		self.read(path)
Beispiel #11
0
 def __init__(self, path):
     XslWorksheet.__init__(self, entry_class=SponsorXlsRecord)
     self.read(path)
     self.lookup = UserDict()
     for item in self:
         self.lookup[item.sponsor] = item.instname
Beispiel #12
0
 def __init__(self, path):
     self.path = path
     self.filename = os.path.basename(path)
     self.root, self.ext = os.path.splitext(self.filename)
     XslWorksheet.__init__(self, entry_class=ReplaceEntry)
     self.read(path)
Beispiel #13
0
 def __init__(self, xls_path):
     XslWorksheet.__init__(self, entry_class=DaresXlsRecord)
     self.read(xls_path)
 def __init__(self, path=None):
     path = path or self.default_path
     XslWorksheet.__init__(self, entry_class=PubsCountry)
     self.read(path)
     self.sort()
 def __init__(self):
     XslWorksheet.__init__(self, entry_class=NameRecord)
     self.read(self.path)
Beispiel #16
0
 def __init__(self):
     XslWorksheet.__init__(self)
     self.read(self.path)
Beispiel #17
0
 def __init__(self, path=None):
     path = path or self.default_path
     XslWorksheet.__init__(self, entry_class=DataHubProvItem)
     self.read(path)
     self.sort()
Beispiel #18
0
 def __init__(self, path):
     XslWorksheet.__init__(self, entry_class=PubNameEntry)
     self.read(path)
     print "%d records read" % len(self)
Beispiel #19
0
 def __init__(self):
     XslWorksheet.__init__(self, entry_class=LexiconEntry)
     self.read(self.data_path)