IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
소스 검색

Started thinking about support for Docker registries.

master
부모
커밋
317c782ac6
1개의 변경된 파일47개의 추가작업 그리고 0개의 파일을 삭제
  1. +47
    -0
      focker/pull.py

+ 47
- 0
focker/pull.py 파일 보기

@@ -0,0 +1,47 @@
from http.client import HTTPConnection, \
HTTPSConnection
from urllib.parse import urlparse
def get(url, headers={}):
url = urlparse(url)
netloc = url.netloc.split(':')
host = netloc[0]
if url.scheme == 'https':
conn = HTTPSConnection(netloc[0], netloc[1] \
if len(netloc) > 1 else 443)
else:
conn = HTTPConnection(netloc[0], netloc[1] \
if len(netloc) > 1 else 80)
req = conn.request('GET', url.path + ('?' + url.query \
if url.query else ''), headers=headers)
resp = conn.getresponse()
status, reason = resp.status, resp.reason
if status == 200:
return (status, reason, resp.read(), resp)
else:
return (status, reason, None, resp)
class RegistryClient(object):
def __init__(self, url):
self.url = url
def authAnon(self):
get(url)
def command_reg_search(args):
raise NotImplementedError
def command_reg_tags(args):
raise NotImplementedError
def command_reg_pull(args):
raise NotImplementedError
def command_reg_push(args):
raise NotImplementedError

불러오는 중...
취소
저장