Skip to content

Commit

Permalink
Package renamed from pgxn.client to pgxnclient
Browse files Browse the repository at this point in the history
After the comment from Marti (Raudesepp, I bet) that the point would lead
to renames by the distributions.
  • Loading branch information
dvarrazzo committed May 1, 2011
1 parent 7e81c63 commit 80ce47e
Show file tree
Hide file tree
Showing 21 changed files with 130 additions and 140 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
# pgxn.client Makefile
# pgxnclient Makefile
#
# Copyright (C) 2011 Daniele Varrazzo
#
Expand Down
10 changes: 0 additions & 10 deletions pgxn/__init__.py

This file was deleted.

10 changes: 5 additions & 5 deletions pgxn/client/__init__.py → pgxnclient/__init__.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- main package
pgxnclient -- main package
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -13,11 +13,11 @@
import re
import operator as _op

from pgxn.client.i18n import _
from pgxn.client.errors import BadSpecError, ResourceNotFound
from pgxnclient.i18n import _
from pgxnclient.errors import BadSpecError, ResourceNotFound

from pgxn.utils.semver import SemVer
from pgxn.utils.label import Label
from pgxnclient.utils.semver import SemVer
from pgxnclient.utils.label import Label


class Spec(object):
Expand Down
8 changes: 4 additions & 4 deletions pgxn/client/api.py → pgxnclient/api.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- client API stub
pgxnclient -- client API stub
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -8,9 +8,9 @@

from urllib import urlencode

from pgxn.utils import json
from pgxn.utils.uri import expand_template
from pgxn.client.network import get_file
from pgxnclient.utils import json
from pgxnclient.utils.uri import expand_template
from pgxnclient.network import get_file

class Api(object):
def __init__(self, mirror):
Expand Down
4 changes: 2 additions & 2 deletions pgxn/client/cli.py → pgxnclient/cli.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- command line entry point
pgxnclient -- command line entry point
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -8,7 +8,7 @@

import sys

from pgxn.client.commands import get_option_parser, run_commands
from pgxnclient.commands import get_option_parser, run_commands

def main(argv=None):
if argv is None:
Expand Down
32 changes: 16 additions & 16 deletions pgxn/client/commands.py → pgxnclient/commands.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- commands module
pgxnclient -- commands module
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -8,17 +8,17 @@

import os
import logging
from pgxn.utils import json
from pgxn.utils import argparse
from pgxnclient.utils import json
from pgxnclient.utils import argparse

from pgxn.client import __version__
from pgxn.client import Spec, Label, SemVer
from pgxn.client.api import Api
from pgxn.client.i18n import _, N_, gettext
from pgxn.client.errors import PgxnClientException, UserAbort
from pgxn.client.network import download
from pgxnclient import __version__
from pgxnclient import Spec, Label, SemVer
from pgxnclient.api import Api
from pgxnclient.i18n import _, N_, gettext
from pgxnclient.errors import PgxnClientException, UserAbort
from pgxnclient.network import download

logger = logging.getLogger('pgxn.client.commands')
logger = logging.getLogger('pgxnclient.commands')

def get_option_parser():
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -133,7 +133,7 @@ def confirm(self, prompt):
prompt = _("Please answer yes or no")


from pgxn.client.errors import ResourceNotFound
from pgxnclient.errors import ResourceNotFound

class Mirror(Command):
name = 'mirror'
Expand Down Expand Up @@ -202,8 +202,8 @@ def run(self):
print "%s %s" % (hit['dist'], hit['version'])


from pgxn.client.errors import BadSpecError
from pgxn.utils.zip import get_meta_from_zip
from pgxnclient.errors import BadSpecError
from pgxnclient.utils.zip import get_meta_from_zip

class CommandWithSpec(Command):
# TODO: the spec should possibly be a local file or a full url
Expand Down Expand Up @@ -402,8 +402,8 @@ def print_details(self, spec, ver):
print "%s: %s: %s %s" % (phase, rel, pkg, ver)


from pgxn.utils import sha1
from pgxn.client.errors import BadChecksum
from pgxnclient.utils import sha1
from pgxnclient.errors import BadChecksum

class Download(CommandWithSpec):
name = 'download'
Expand Down Expand Up @@ -468,7 +468,7 @@ def _get_local_file_name(self, url):
import shutil
import tempfile
from subprocess import Popen, PIPE
from pgxn.utils.zip import unpack
from pgxnclient.utils.zip import unpack

class WithUnpacking(object):
def call_with_temp_dir(self, f, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions pgxn/client/errors.py → pgxnclient/errors.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- package exceptions
pgxnclient -- package exceptions
These exceptions can be used to signal expected problems and to exit in a
controlled way from the program.
Expand All @@ -14,7 +14,7 @@ class PgxnException(Exception):
"""Base class for the exceptions known in the pgxn package."""

class PgxnClientException(PgxnException):
"""Base class for the exceptions raised by the pgxn.client package."""
"""Base class for the exceptions raised by the pgxnclient package."""

class UserAbort(PgxnClientException):
"""The user requested to stop the operation."""
Expand Down
2 changes: 1 addition & 1 deletion pgxn/client/i18n.py → pgxnclient/i18n.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- internationalization support
pgxnclient -- internationalization support
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand Down
12 changes: 6 additions & 6 deletions pgxn/client/network.py → pgxnclient/network.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- network interaction
pgxnclient -- network interaction
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -10,16 +10,16 @@
import urllib2
from itertools import count

from pgxn.client import __version__
from pgxn.client.i18n import _
from pgxn.client.errors import NetworkError, ResourceNotFound, BadRequestError
from pgxnclient import __version__
from pgxnclient.i18n import _
from pgxnclient.errors import NetworkError, ResourceNotFound, BadRequestError

import logging
logger = logging.getLogger('pgxn.client.network')
logger = logging.getLogger('pgxnclient.network')

def get_file(url):
opener = urllib2.build_opener()
opener.addheaders = [('User-agent', 'pgxn.client/%s' % __version__)]
opener.addheaders = [('User-agent', 'pgxnclient/%s' % __version__)]
logger.debug('opening url: %s', url)
try:
return opener.open(url)
Expand Down
2 changes: 1 addition & 1 deletion pgxn/utils/__init__.py → pgxnclient/utils/__init__.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- misc utilities package
pgxnclient -- misc utilities package
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pgxn/utils/label.py → pgxnclient/utils/label.py
Expand Up @@ -9,7 +9,7 @@

import re

from pgxn.client.i18n import _
from pgxnclient.i18n import _


class Label(str):
Expand Down
2 changes: 1 addition & 1 deletion pgxn/utils/semver.py → pgxnclient/utils/semver.py
Expand Up @@ -22,7 +22,7 @@
import re
import operator

from pgxn.client.i18n import _
from pgxnclient.i18n import _

class SemVer(str):
"""A string representing a semantic version number.
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions pgxn/utils/zip.py → pgxnclient/utils/zip.py
@@ -1,5 +1,5 @@
"""
pgxn.client -- zip file utilities
pgxnclient -- zip file utilities
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -11,12 +11,12 @@
import shutil
from zipfile import ZipFile

from pgxn.utils import json
from pgxn.client.i18n import _
from pgxn.client.errors import PgxnClientException
from pgxnclient.utils import json
from pgxnclient.i18n import _
from pgxnclient.errors import PgxnClientException

import logging
logger = logging.getLogger('pgxn.utils.zip')
logger = logging.getLogger('pgxnclient.utils.zip')

def unpack(zipname, destdir):
logger.info(_("unpacking: %s"), zipname)
Expand Down
8 changes: 4 additions & 4 deletions scripts/pgxncli.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
pgxn.client -- command line interface
pgxnclient -- command line interface
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -9,9 +9,9 @@

import sys

from pgxn.client.cli import main
from pgxn.client.i18n import _
from pgxn.client.errors import PgxnException, UserAbort
from pgxnclient.cli import main
from pgxnclient.i18n import _
from pgxnclient.errors import PgxnException, UserAbort

import logging
logging.basicConfig(
Expand Down
8 changes: 4 additions & 4 deletions setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
pgxn.client -- setup script
pgxnclient -- setup script
"""

# Copyright (C) 2011 Daniele Varrazzo
Expand All @@ -10,15 +10,15 @@

from distutils.core import setup

from pgxn.client import __version__
from pgxnclient import __version__

setup(name='pgxn.client',
setup(name='pgxnclient',
version=__version__,
description='A command line tool to interact with the PostgreSQL Extension Network.',
author='Daniele Varrazzo',
author_email='daniele.varrazzo@gmail.com',
url='https://github.com/dvarrazzo/pgxn-client/',
packages=['pgxn', 'pgxn.client', 'pgxn.utils'],
packages=['pgxnclient', 'pgxnclient.utils'],
scripts=['scripts/pgxn', 'scripts/pgxncli.py'],
license='BSD',
)
Expand Down

0 comments on commit 80ce47e

Please sign in to comment.