Mercurial > hg > toolbox
annotate scripts/setup_scraper.py @ 3:11173b4a7ca8
avoid namespace collision
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 19 Dec 2016 12:28:19 -0800 |
parents | b0942f44413f |
children |
rev | line source |
---|---|
0
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
1 """ |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
2 scrapes metadata from a python setup.py file |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
3 """ |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
4 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
5 import imp |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
6 import sys |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
7 import urllib2 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
8 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
9 # dictionary of |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
10 data = {} |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
11 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
12 def mock_setup(**kwargs): |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
13 """ |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
14 mock the distutils/setuptools setup function |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
15 """ |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
16 import pdb; pdb.set_trace() |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
17 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
18 def setuppy2tool(url): |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
19 """ |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
20 reads a file path or URL (TODO) |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
21 returns a dict in the appropriate format |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
22 """ |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
23 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
24 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
25 |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
26 if __name__ == '__main__': |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
27 for arg in sys.argv[1:]: |
b0942f44413f
import from git://github.com/mozilla/toolbox.git
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
28 print setuppy2tool(arg) |