Esempio n. 1
0
 def convert_to_org(self, cals):
     for name in cals:
         ics_fname = os.path.join(self.config['ics dir'], self.config['prefix']+name+".ics")
         org_fname = os.path.join(self.config['org dir'], self.config['prefix']+name+".org")
         if u.time_to_build(ics_fname, org_fname):
             with hide("running", "output"):
                 logger.info("Writing " + org_fname)
                 local("{3} -v category={2} < {0} 2>/dev/null 1> {1}".format(ics_fname, org_fname, name, self.config['ical2org']))
Esempio n. 2
0
    def ttb(func, output, depends, *args, **kwargs):
        """func is a conversion function to run on the args and kwargs to produce the output.
    
        depends is a string or list of filespecs

        **kwargs are whatever the func calls for.

        output is a filespec.  We run u.time_to_build on the output
        and depends and if it comes back saying the output file is out
        of date, we rebuild it from the depends, args and kwargs by
        calling the func.

        """
        if u.time_to_build(u.str2list(depends), output):
            return func(output, depends, *args, **kwargs)