コード例 #1
0
ファイル: blox.py プロジェクト: llimllib/cherry-blossom
    def __init__(self):
        self.timeformats =  [["%Y", "%d", "%m", "%b", "%B"],
            ["%Y %b", "%Y %m", "%Y %b", "%Y %B", "%m %d", "%b %d", "%B %d"],
            ["%Y %m %d", "%Y %b %d", "%Y %B %d"]]
        self.plugins = [] #contains all loaded plugins

        #set the output encoding
        self._cp_config["cpy.tools.encode.encoding"] = "utf-8"

        self.now = datetime.datetime.now
        self.last_update = self.now()
        self.num_entries = config('num_entries')
        self.datadir = config('datadir')
        self.ignore_directories = config('ignore_directories')
        self.fp = '' #a cache of the front page content
        self.index() #thus, we don't have to parse the metadata of the front 
                     #page article when the second request comes in
        self.init_plugins(config('plugins'))
        FileCabinet.get_most_recent(self.datadir) #initialize entries
コード例 #2
0
ファイル: blox.py プロジェクト: Tubbz-alt/cherry-blossom
    def __init__(self):
        self.timeformats = [["%Y", "%d", "%m", "%b", "%B"],
                            [
                                "%Y %b", "%Y %m", "%Y %b", "%Y %B", "%m %d",
                                "%b %d", "%B %d"
                            ], ["%Y %m %d", "%Y %b %d", "%Y %B %d"]]
        self.plugins = []  #contains all loaded plugins

        #set the output encoding
        self._cp_config["cpy.tools.encode.encoding"] = "utf-8"

        self.now = datetime.datetime.now
        self.last_update = self.now()
        self.num_entries = config('num_entries')
        self.datadir = config('datadir')
        self.ignore_directories = config('ignore_directories')
        self.fp = ''  #a cache of the front page content
        self.index()  #thus, we don't have to parse the metadata of the front
        #page article when the second request comes in
        self.init_plugins(config('plugins'))
        FileCabinet.get_most_recent(self.datadir)  #initialize entries
コード例 #3
0
ファイル: blox.py プロジェクト: llimllib/cherry-blossom
 def files(self, offset):
     return FileCabinet.get_most_recent(self.datadir, self.num_entries, \
         self.ignore_directories, offset)
コード例 #4
0
ファイル: blox.py プロジェクト: Tubbz-alt/cherry-blossom
 def files(self, offset):
     return FileCabinet.get_most_recent(self.datadir, self.num_entries, \
         self.ignore_directories, offset)