aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2014-05-17 13:47:54 +0200
committerVictor Häggqvist <[email protected]>2014-05-17 13:47:54 +0200
commit4c421058712c0e61fa910baea438359124a0d56f (patch)
treebe7f154e688600b44253abd64d0364effc737761
parent309cc97f6cea5c2b54ea1f737aad6368eaf3c174 (diff)
alias for urllib
-rwxr-xr-xgiti.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/giti.py b/giti.py
index 4799314..c7772fb 100755
--- a/giti.py
+++ b/giti.py
@@ -2,7 +2,7 @@
# coding=utf-8
import os.path
import sys
-import urllib2
+import urllib2 as urllib
__author__ = 'Victor Häggqvist'
__version__ = '0.1.1'
@@ -14,9 +14,9 @@ def gitiglobal(type):
"""
print "Fetching .gitignore for", type,"in Global"
try:
- gifile = urllib2.urlopen("https://raw.githubusercontent.com/github/gitignore/master/Global/"+type+".gitignore").read()
+ gifile = urllib.urlopen("https://raw.githubusercontent.com/github/gitignore/master/Global/"+type+".gitignore").read()
store(gifile)
- except urllib2.HTTPError as e:
+ except urllib.HTTPError as e:
if e.code == 404:
print "Not found in global either"
else:
@@ -54,9 +54,9 @@ def giti(type):
print "Fetching .gitignore for", type
try:
- gifile = urllib2.urlopen("https://raw.githubusercontent.com/github/gitignore/master/"+type+".gitignore").read()
+ gifile = urllib.urlopen("https://raw.githubusercontent.com/github/gitignore/master/"+type+".gitignore").read()
store(gifile)
- except urllib2.HTTPError as e:
+ except urllib.HTTPError as e:
if e.code == 404:
print "Not found in master"
gitiglobal(type)