Skip to content

Instantly share code, notes, and snippets.

@kdwinter
Created September 13, 2009 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdwinter/186278 to your computer and use it in GitHub Desktop.
Save kdwinter/186278 to your computer and use it in GitHub Desktop.
import os
#import sys
from urllib2 import urlopen
#import simplejson
DownloadPath = os.environ['HOME']+'/abs'
class Aur(object):
'''AUR handling methods'''
def __init__(self, options):
'''Constructor. Accepts options (dict).'''
self.options = options
def download(self, package):
'''Download a package'''
remote = urlopen('http://aur.archlinux.org/packages/'+package+'/'+package+'.tar.gz')
local = open(self.options['path']+'/'+package+'.tar.gz', 'wb')
local.write(remote.read())
local.close
aur = Aur({'path': DownloadPath})
aur.download('aurb')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment