~ubuntu-branches/ubuntu/precise/pybackpack/precise

« back to all changes in this revision

Viewing changes to src/pybackpack/findfiles.py

  • Committer: Bazaar Package Importer
  • Author(s): Andy Price, Andy Price, Piotr Ożarowski, Marco Rodrigues
  • Date: 2007-12-23 15:07:21 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071223150721-16ur0rbpnlppmbz3
Tags: 0.5.4-1
[ Andy Price ]
* New upstream release
* Update debian/docs - TODO file has been removed
* Depend on genisoimage which upstream now uses
* Remove debian/dirs - distutils creates usr/bin
* Fix section in debian/menu to follow menu guidelines

[ Piotr Ożarowski ]
* Homepage field added
* Rename XS-Vcs-* fields to Vcs-* (dpkg supports them now)

[ Marco Rodrigues ]
* Update Standards-Version to 3.7.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import sys
2
 
import os
3
 
 
4
 
def FindFiles(base=None):
5
 
        """Scans the directory at base (defaults to home directory)
6
 
        for known files+settings"""
7
 
        db = {
8
 
                "Gaim" : ".gaim/",
9
 
                "Firefox" : ".mozilla/firefox/",
10
 
                "Thunderbird" : ".thunderbird/",
11
 
                "Thunderbird" : ".mozilla-thunderbird/"
12
 
        }
13
 
        found = []
14
 
 
15
 
        if base == None:
16
 
                base = os.path.expanduser("~")
17
 
        if base[:-1] != "/":
18
 
                base += "/"
19
 
 
20
 
        for name,path in db.items():
21
 
                if os.path.exists(base+path):
22
 
                        print _("Found %s settings.") % name
23
 
                        found.append((name, base+path))
24
 
 
25
 
        return found