~james-w/pkgme-devportal/remove-tempdir-after-use

« back to all changes in this revision

Viewing changes to devportalbinary/backends/pdf/want

  • Committer: Tarmac
  • Author(s): James Westby, James Westby
  • Date: 2011-12-13 12:53:41 UTC
  • mfrom: (18.2.3 pdf-backend)
  • Revision ID: tarmac@server-3224-20111213125341-z46ucgmzy632jnte
[r=jml] Add a pdf backend.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# Copyright 2011 Canonical Ltd.  This software is licensed under the
 
3
# GNU Affero General Public License version 3 (see the file LICENSE).
 
4
 
 
5
import os
 
6
 
 
7
from devportalbinary.binary import METADATA_FILE
 
8
 
 
9
def main():
 
10
    want = False
 
11
    if os.path.exists(METADATA_FILE):
 
12
        files = os.listdir('.')
 
13
        files = [f for f in files if f not in (METADATA_FILE, 'debian')]
 
14
        if len(files) == 1:
 
15
            if files[0].endswith(".pdf"):
 
16
                want = True
 
17
    if want:
 
18
        print 20
 
19
    else:
 
20
        print 0
 
21
 
 
22
 
 
23
if __name__ == '__main__':
 
24
    main()