[Python-modules-commits] [python-aptly] 01/03: Import python-aptly_0.8.orig.tar.gz
Filip Pytloun
fpytloun-guest at moszumanska.debian.org
Fri Dec 2 13:36:40 UTC 2016
This is an automated email from the git hooks/post-receive script.
fpytloun-guest pushed a commit to branch master
in repository python-aptly.
commit ba653c899364a694d92dd4e47e720ab928bcfa30
Author: Filip Pytloun <filip at pytloun.cz>
Date: Fri Dec 2 14:29:40 2016 +0100
Import python-aptly_0.8.orig.tar.gz
---
README.rst | 8 +++++---
aptly/publisher/__init__.py | 10 +++++-----
aptly/publisher/__main__.py | 9 +++++----
setup.py | 3 ++-
4 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/README.rst b/README.rst
index 73dc947..9bfd043 100644
--- a/README.rst
+++ b/README.rst
@@ -31,6 +31,8 @@ Features
- cleanup unused snapshots
+- Supports Python 3 (recommended) and Pythonn 2
+
Create or update publish
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -182,8 +184,8 @@ You can install directly using from local checkout or from pip:
::
- python setup.py install
- pip install python-aptly
+ python3 setup.py install
+ pip3 install python-aptly
Or better build Debian package with eg.:
@@ -200,7 +202,7 @@ man page.
::
- PYTHONPATH=. help2man -n "aptly-publisher - tool for easy creation of Aptly multi component publishes" --version-string=$(grep version setup.py|cut -d '"' -f 2) "python aptly/publisher/__main__.py" | sed -e s,__main__.py,aptly-publisher,g -e s,__MAIN__.PY,APTLY-PUBLISHER,g > aptly-publisher.1
+ PYTHONPATH=. help2man -n "aptly-publisher - tool for easy creation of Aptly multi component publishes" --version-string=$(grep version setup.py|cut -d '"' -f 2) "python3 aptly/publisher/__main__.py" | sed -e s,__main__.py,aptly-publisher,g -e s,__MAIN__.PY,APTLY-PUBLISHER,g > aptly-publisher.1
man aptly-publisher.1
Also see ``doc/examples`` directory.
diff --git a/aptly/publisher/__init__.py b/aptly/publisher/__init__.py
index 5af33f5..29773bb 100644
--- a/aptly/publisher/__init__.py
+++ b/aptly/publisher/__init__.py
@@ -54,7 +54,7 @@ class PublishManager(object):
except KeyError:
publish_names = None
- for publish in self._publishes.itervalues():
+ for publish in self._publishes.values():
if self._publish_match(publish.name, publish_names):
publish.do_publish(*args, **kwargs)
else:
@@ -64,7 +64,7 @@ class PublishManager(object):
keys = {}
for e in seq:
keys[e] = 1
- return keys.keys()
+ return list(keys.keys())
def cleanup_snapshots(self):
snapshots = self.client.do_get('/snapshots', {'sort': 'time'})
@@ -154,11 +154,11 @@ class Publish(object):
diff, equal = ({}, {})
- for component, snapshots in self.components.iteritems():
+ for component, snapshots in self.components.items():
if component not in other.components:
continue
- if component not in other.components.keys():
+ if component not in list(other.components.keys()):
# Component is missing in other
diff[component] = snapshots
continue
@@ -277,7 +277,7 @@ class Publish(object):
Create component snapshots by merging other snapshots of same component
"""
self.publish_snapshots = []
- for component, snapshots in self.components.iteritems():
+ for component, snapshots in self.components.items():
if len(snapshots) <= 1:
# Only one snapshot, no need to merge
lg.debug("Component %s has only one snapshot %s, not creating merge snapshot" % (component, snapshots))
diff --git a/aptly/publisher/__main__.py b/aptly/publisher/__main__.py
index 586860b..458769c 100644
--- a/aptly/publisher/__main__.py
+++ b/aptly/publisher/__main__.py
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
+
import sys
import argparse
from aptly.client import Aptly
@@ -119,7 +120,7 @@ def action_promote(client, source, target, components=None, recreate=False,
if packages:
# We are only going to promote specific packages
- for component, snapshots in publish_source.components.iteritems():
+ for component, snapshots in publish_source.components.items():
if components and component not in components:
# We don't want to promote this component
continue
@@ -165,7 +166,7 @@ def action_diff(source, target, components=[], packages=True):
return
print("\033[1;36m= Differencies per component\033[m")
- for component, snapshots in diff.iteritems():
+ for component, snapshots in diff.items():
if not snapshots:
continue
@@ -216,7 +217,7 @@ def action_publish(client, publishmgr, config_file, recreate=False,
snapshots = client.do_get('/snapshots', {'sort': 'time'})
config = load_config(config_file)
- for name, repo in config.get('mirror', {}).iteritems():
+ for name, repo in config.get('mirror', {}).items():
snapshot = get_latest_snapshot(snapshots, name)
if not snapshot:
continue
@@ -226,7 +227,7 @@ def action_publish(client, publishmgr, config_file, recreate=False,
snapshot=snapshot
)
- for name, repo in config.get('repo', {}).iteritems():
+ for name, repo in config.get('repo', {}).items():
snapshot = get_latest_snapshot(snapshots, name)
if not snapshot:
continue
diff --git a/setup.py b/setup.py
index 7f3731b..6003dbc 100755
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ long_desc = open('README.rst').read()
setup(
name="python-aptly",
- version="0.7.11",
+ version="0.8",
description="Aptly REST API client and tooling",
long_description=long_desc,
author="Filip Pytloun",
@@ -31,6 +31,7 @@ setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
],
keywords='aptly debian repository',
)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-aptly.git
More information about the Python-modules-commits
mailing list