def GetStatus(self,directory,files=None,service=None):
logger.debug("<STR_LIT>" %(directory))<EOL>db=self._loadDB(directory)<EOL>filedict=self._findFiles(directory,files)<EOL>logger.debug("<STR_LIT>"%(len(filedict.keys())))<EOL>logger.debug("<STR_LIT>"%(len(db.keys())))<EOL>keys=filedict.keys()<EOL>keys.sort()<EOL>for fn in keys:<EOL><INDENT>if fn in db:<EOL><INDENT>filedict[fn]['<STR_LIT:status>']=self._computeStatus(db[fn],service)<EOL>if filedict[fn]['<STR_LIT>'] > db[fn]['<STR_LIT>']:<EOL><INDENT>newhash=self._hashfile(os.path.join(directory,fn))<EOL>for srv in db[fn]['<STR_LIT>']:<EOL><INDENT>if db[fn]['<STR_LIT>'][srv]['<STR_LIT:status>']==self.ST_UPTODATE:<EOL><INDENT>if newhash!=db[fn]['<STR_LIT>']:<EOL><INDENT>filedict[fn]['<STR_LIT:status>']=self.ST_MODIFIED<EOL>db[fn]['<STR_LIT>'][srv]['<STR_LIT:status>']=self.ST_MODIFIED<EOL><DEDENT>else:<EOL><INDENT>db[fn]['<STR_LIT>']=filedict[fn]['<STR_LIT>']<EOL>self._saveDB(directory,db)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>filedict[fn]['<STR_LIT:status>']=self._computeStatus(db[fn],service)<EOL><DEDENT>else:<EOL><INDENT>filedict[fn]['<STR_LIT:status>']=self.ST_UNTRACKED<EOL><DEDENT><DEDENT>return filedict,db<EOL>
Scans through all files in direcotory,
        opens DB (if any), and returns dictionary (where filename is key)
        of files and their status

        - Returns dictionary where filename is key
        - Status can be:
            - ? : Not tracked
            - S : Synched, in DB and on FLICKR
            - A : Added, will be pushed on checkin
            - M : Modified locally, will push to flicker on checkin
            - D : Deleted locally, will remove from flickr on checkin
            - C : Complicated (different states depending on service)
        Dictionary has format
        d['service']    - Class object handling this file (None if not handled)
        d['status']     - ?/S/A/M/D/C
        - Hash never computed here

        Also returns DB dictionary, where filename is key