Exemple #1
0
 def __init__(self, index_url=None, eggs_dir=None):
     if not index_url:
         index_url = config.get("eggproxy", "index")
     if not eggs_dir:
         eggs_dir = config.get("eggproxy", "eggs_directory")
     if not os.path.isdir(eggs_dir):
         create_eggs_directory = config.getboolean("eggproxy", "create_eggs_directory")
         if create_eggs_directory:
             print "Creating the %r directory" % eggs_dir
             os.makedirs(eggs_dir)
         else:
             print "You must create the %r directory" % eggs_dir
             sys.exit()
     self.eggs_index_proxy = IndexProxy(PackageIndex(index_url=index_url))
     self.eggs_dir = eggs_dir
Exemple #2
0
## You should have received a copy of the GNU General Public License
## along with this program; see the file COPYING. If not, write to the
## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import os
import socket
import sys
from paste import httpserver
from paste.script.appinstall import Installer as BaseInstaller
from paste.fileapp import FileApp
from paste.httpexceptions import HTTPNotFound
from collective.eggproxy.utils import PackageIndex
from collective.eggproxy import IndexProxy
from collective.eggproxy import PackageNotFound
from collective.eggproxy.config import config

ALWAYS_REFRESH = config.getboolean('eggproxy', 'always_refresh')
if ALWAYS_REFRESH:
    print "Always-refresh mode switched on"
    # Apply timeout setting right here. Might not be the best spot. Timeout is
    # needed for the always_refresh option to keep a down pypi from blocking
    # the proxy.
    timeout = config.get('eggproxy', 'timeout')
    socket.setdefaulttimeout(int(timeout))


class EggProxyApp(object):

    def __init__(self, index_url=None, eggs_dir=None):
        if not index_url:
            index_url = config.get('eggproxy', 'index')
        if not eggs_dir:
Exemple #3
0
    safe_name,
    safe_version,
    to_filename,
    HREF,
    htmldecode,
    find_external_links,
    PYPI_MD5,
)

from pkg_resources import Requirement
from collective.eggproxy.config import config
import logging

log = logging.getLogger("collective.eggproxy.utils")

ALWAYS_REFRESH = config.getboolean("eggproxy", "always_refresh")
EGGS_DIR = config.get("eggproxy", "eggs_directory")
INDEX_URL = config.get("eggproxy", "index")
# INDEX is defined *after* the PackageIndex class.


class PackageIndex(BasePackageIndex):
    """
    """

    def can_add(self, dist):
        """Overrides PackageIndex.can_add method to remove filter on python
    major version: we want packages for all versions, all platforms
        """
        return True
Exemple #4
0
## You should have received a copy of the GNU General Public License
## along with this program; see the file COPYING. If not, write to the
## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import os
import socket
import sys
from paste import httpserver
from paste.script.appinstall import Installer as BaseInstaller
from paste.fileapp import FileApp
from paste.httpexceptions import HTTPNotFound
from collective.eggproxy.utils import PackageIndex
from collective.eggproxy import IndexProxy
from collective.eggproxy import PackageNotFound
from collective.eggproxy.config import config

ALWAYS_REFRESH = config.getboolean('eggproxy', 'always_refresh')
if ALWAYS_REFRESH:
    print "Always-refresh mode switched on"
    # Apply timeout setting right here. Might not be the best spot. Timeout is
    # needed for the always_refresh option to keep a down pypi from blocking
    # the proxy.
    timeout = config.get('eggproxy', 'timeout')
    socket.setdefaulttimeout(int(timeout))


class EggProxyApp(object):
    def __init__(self, index_url=None, eggs_dir=None):
        if not index_url:
            index_url = config.get('eggproxy', 'index')
        if not eggs_dir:
            eggs_dir = config.get('eggproxy', 'eggs_directory')