Jonathan Kolberg has proposed merging lp:~bulldog98/kubuntu-dev-tools/trunk 
into lp:kubuntu-dev-tools.

Requested reviews:
  Kubuntu Packagers (kubuntu-packagers)

For more details, see:
https://code.launchpad.net/~bulldog98/kubuntu-dev-tools/trunk/+merge/73672

This adds 2 new functions using launchpadlib and zsh completion for most of the 
commands
-- 
https://code.launchpad.net/~bulldog98/kubuntu-dev-tools/trunk/+merge/73672
Your team Kubuntu Packagers is requested to review the proposed merge of 
lp:~bulldog98/kubuntu-dev-tools/trunk into lp:kubuntu-dev-tools.
=== added file 'bin/kshowbranches'
--- bin/kshowbranches	1970-01-01 00:00:00 +0000
+++ bin/kshowbranches	2011-09-01 14:20:25 +0000
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+#--
+# Copyright (C) 2011 Jonathan Kolberg <[email protected]>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License or (at your option) version 3 or any later version
+# accepted by the membership of KDE e.V. (or its successor approved
+# by the membership of KDE e.V.), which shall act as a proxy
+# defined in Section 14 of version 3 of the license.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#--
+
+import sys
+from launchpadlib.launchpad import Launchpad
+
+lp = Launchpad.login_with('kshowbranches', 'production')
+
+team = lp.people['kubuntu-packagers']
+branches = team.getBranches()
+
+for branch in branches:
+    print branch.bzr_identity
\ No newline at end of file

=== added file 'bin/kshowseries'
--- bin/kshowseries	1970-01-01 00:00:00 +0000
+++ bin/kshowseries	2011-09-01 14:20:25 +0000
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+#--
+# Copyright (C) 2011 Jonathan Kolberg <[email protected]>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License or (at your option) version 3 or any later version
+# accepted by the membership of KDE e.V. (or its successor approved
+# by the membership of KDE e.V.), which shall act as a proxy
+# defined in Section 14 of version 3 of the license.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#--
+
+import sys
+from launchpadlib.launchpad import Launchpad
+
+lp = Launchpad.login_with('kshowseries', 'production')
+
+ubuntu = lp.distributions["ubuntu"]
+series = ubuntu.series_collection_link
+
+for serie in ubuntu.series:
+    if serie.active:
+        print serie.name
\ No newline at end of file

=== added directory 'zsh_completion'
=== added file 'zsh_completion/_astyle-kubuntu'
--- zsh_completion/_astyle-kubuntu	1970-01-01 00:00:00 +0000
+++ zsh_completion/_astyle-kubuntu	2011-09-01 14:20:25 +0000
@@ -0,0 +1,3 @@
+#compdef astyle-kubuntu
+
+_arguments "1: :."
\ No newline at end of file

=== added file 'zsh_completion/_batpaste'
--- zsh_completion/_batpaste	1970-01-01 00:00:00 +0000
+++ zsh_completion/_batpaste	2011-09-01 14:20:25 +0000
@@ -0,0 +1,3 @@
+#compdef batpaste
+
+_arguments '1:file to paste:_files'
\ No newline at end of file

=== added file 'zsh_completion/_kbranchmover'
--- zsh_completion/_kbranchmover	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kbranchmover	2011-09-01 14:20:25 +0000
@@ -0,0 +1,2 @@
+#compdef kbranchmover
+_message "no more arguments"
\ No newline at end of file

=== added file 'zsh_completion/_kbzr'
--- zsh_completion/_kbzr	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kbzr	2011-09-01 14:20:25 +0000
@@ -0,0 +1,422 @@
+#compdef kbzr
+
+#This is a modified version of _bzr shipped with zsh
+
+local curcontext="$curcontext" state line expl cmd args ret=1
+typeset -A opt_args
+
+_arguments -C \
+    '1: :->cmd' \
+    '*:: :->args' && ret=0
+
+if (( ! $+_bzr_cmds )); then
+    typeset -gH _bzr_cmds
+    _bzr_cmds=(${(f)"$(_call_program bzr bzr shell-complete)"})
+fi
+
+if [[ $state != 'args' ]]; then
+    _describe -t subcommand 'subcommand' _bzr_cmds
+    return 0
+fi
+
+cmd="$words[1]"
+curcontext="${curcontext%:*:*}:bzr-$cmd:"
+
+(( $+functions[_bzr_unknownFiles] )) ||
+_bzr_unknownFiles() {
+    local fileList
+    fileList=(${(ps:\0:)"$(bzr ls --null --unknown)"})
+    compadd -af fileList
+    return 0
+}
+
+(( $+functions[_bzr_unknownRoot] )) ||
+_bzr_unknownRoot() {
+    local fileList
+    fileList=(${(ps:\0:)"$(bzr ls --null --from-root --unknown)"})
+    compadd -af fileList
+    return 0
+}
+
+(( $+functions[_bzr_versionedFiles] )) ||
+_bzr_versionedFiles() {
+    local fileList
+    fileList=(${(ps:\0:)"$(bzr ls --null --versioned)"})
+    compadd -af fileList
+    return 0
+}
+
+(( $+functions[_bzr_completeParents] )) ||
+_bzr_completeParents() {
+    local parentFile=$(bzr root 2>/dev/null)/.bzr/branch/parent
+    [[ -r $parentFile ]] && compadd -X "Completing parents" $(cat $parentFile)
+}
+
+(( $+functions[_kubuntu_completion] )) ||
+_kubuntu_completion() {
+	if ( [[ ${+_kubuntu_completion_cache_packages} -eq 0 ]] ||
+		_cache_invalid KUBUNTU_PACKAGES_CACHE) && ! _retrieve_cache KUBUNTU_PACKAGES_CACHE;
+	then
+		_kubuntu_completion_cache_packages=(
+			${(f)"$(kshowbranches| grep "lp:~kubuntu-packagers/kubuntu-packaging/" |sed 's/lp:\~kubuntu-packagers\/kubuntu-packaging\///' 2>/dev/null)"}
+		)
+
+		_store_cache KUBUNTU_PACKAGES_CACHE _kubuntu_completion_cache_packages
+	fi
+	typeset -gH _kubuntu_completion_cache_packages
+	
+	compadd -x "branch name" -a _kubuntu_completion_cache_packages
+}
+
+args=( '(-)'{--help,-h}'[show help message]' )
+
+case $cmd in
+(add)
+    args+=(
+	'--dry-run[show what would be added without adding anything]'
+	'--no-recurse[do not recurse into subdirectories]'
+	'(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]'
+	'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
+	'*:unknown files:_bzr_unknownFiles'
+	)
+    ;;
+
+(annotate|blame|praise)
+    args+=(
+	'--all[show annotations on all lines]'
+	'--long[show date in annotations]'
+	'(-r --revision)'{--revision=,-r}'[the revision to show]:rev:'
+	'*:files:_bzr_versionedFiles'
+	)
+    ;;
+
+(branch|get|clone)
+    args+=(
+	'(-r --revision)'{--revision=,-r}'[the revision to get]:rev:'
+	'--basis=[specify basis branch]:basis:'
+	)
+    if (( CURRENT == 2 )); then
+	args+=( '*:FROM_LOCATION:_kubuntu_completion' )
+    elif (( CURRENT == 3 )); then
+	args+=( '*:TO_LOCATION:_files -/' )
+    fi
+    ;;
+
+(checkout|co)
+    args+=(
+	'--lightweight[perform a lightweight checkout]'
+	'(-r --revision)'{--revision=,-r}'[the revision to get]:rev:'
+	)
+    _bzr_completeParents
+    ;;
+
+(rename|move|mv)
+    if (( CURRENT == 2 )); then
+	args+=( '*:files:_bzr_versionedFiles' )
+    else
+	args=( '*:destination dir:_files -/' )
+    fi
+    ;;
+
+(cat)
+    args+=(
+	'(-r --revision)'{--revision=,-r}'[revision]:rev:'
+	'*:file:_bzr_versionedFiles'
+	)
+    ;;
+
+(root)
+    args+=( '*:file:_files' )
+    ;;
+
+(log)
+    args+=(
+	'--forward[reverse direction of revisions]'
+	'(-l --long --short --log_format)--line[use log format with one line per revision. Same as "--log-format line"]'
+	'(-l --long --short --line)--log-format=[use the specified log format]:log format:(line short long)'
+	'(-l --long --short --line --log-format)'{--long,-l}'[use detailed log format. Same as "--log-format long"]'
+	'(-l --long --log_format)--short[use moderately short log format. Same as "--log-format short"]'
+	'(-m --message)'{--message=,-m}'[specify regexp]:regexp:'
+	'(-r --revision)'{--revision=,-r}'[revision or range]:rev or rev range:'
+	'--show-ids[show file IDs]'
+	'--timezone=[specify timezone for dates]:timezone:'
+	'(-v --verbose)'{--verbose,-v}'[show revision manifest]'
+	'*:file:_bzr_versionedFiles'
+	)
+    ;;
+
+(resolve|resolved)
+    args+=(
+	'--all[resolve all conflicts in this tree]'
+	'*:file:_bzr_versionedFiles'
+	)
+    ;;
+
+(status|st|stat)
+    args+=(
+	'--all[include unchanged versioned files]'
+	'(-r --revision)'{--revision=,-r}'[compare working tree with revision]:revision:'
+	'--show-ids[show file IDs]'
+	'*:file:_bzr_versionedFiles'
+	)
+    ;;
+
+(check)
+    args+=(
+	'(-v --verbose)'{--verbose,-v}'[display more information]'
+	'*:DIR:_files -/'
+	)
+    ;;
+
+(mkdir|renames|update)
+    args+=( '*:DIR:_files -/' )
+    ;;
+
+(init|upgrade)
+    args+=(
+	'--format=[format for repository]:format:(default knit metaweave weave)'
+	'*:DIR:_files -/'
+	)
+    ;;
+
+(init-repo|init-repository)
+    args+=(
+	'--format=[format for repository]:format:(default knit metaweave weave)'
+	'--trees[allows branches in repository to have a working tree]'
+	'*:DIR:_files -/'
+	)
+    ;;
+
+(remove|rm)
+    args+=(
+	'(-v --verbose)'{--verbose,-v}'[display more information]'
+	'*:file:_bzr_versionedFiles'
+	)
+    ;;
+
+(pull)
+    args+=(
+	'--overwrite[ignore differences, overwrite unconditionally]'
+	'--remember[remember the specified location as a default]'
+	'(-r --revision)'{--revision=,-r}'[get a particular revision]:revision:'
+	'(-v --verbose)'{--verbose,-v}'[display more information]'
+	'*:local repository:_files -/'
+	)
+    _bzr_completeParents
+    ;;
+
+(missing)
+    args+=(
+	'(-l --long --short --log_format)--line[use log format with one line per revision. Same as "--log-format line"]'
+	'(-l --long --short --line)--log-format=[use the specified log format]:log format:(line short long)'
+	'(-l --long --short --line --log-format)'{--long,-l}'[use detailed log format. Same as "--log-format long"]'
+	'(-l --long --log_format)--short[use moderately short log format. Same as "--log-format short"]'
+	'--mine-only[display changes in the local branch only]'
+	'--reverse[reverse the order of revisions]'
+	'--show-ids[show internal object ids]'
+	'--theirs-only[display changes in the remote branch only]'
+	'(-v --verbose)'{--verbose,-v}'[display more information]'
+	'*:local repository:_files -/'
+	)
+    _bzr_completeParents
+    ;;
+
+(commit|checkin|ci)
+    args+=(
+	'(-F --file)'{--file=,-F}'[commit message from file]:message file:'
+	'--local[perform a local only commit in a bound branch]'
+	'(-m --message)'{--message=,-m}'[commit message]:message text:'
+	'--strict[refuse to commit if there are unknown files]'
+	'--unchanged[include unchanged files]'
+	'(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]'
+	'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
+	'*:modified files:_bzr_versionedFiles'
+	)
+    ;;
+
+(bind|break-lock|reconcile)
+    _bzr_completeParents
+    ;;
+
+(register-branch)
+    args+=(
+	'--author=[email of the branch author, if not you]:email:'
+	'--branch-description=[longer description of the branch]:description:'
+	'--branch-name=[short name for the branch]:name:'
+	'--branch-title=[one-sentence description of the branch]:title:'
+	'--dry-run[prepare the request but do not actually send it]'
+	'--link-bug=[the bug this branch fixes]:bug-ID:'
+	'--product=[launchpad product short name to associate with the branch]:product:'
+	)
+    _bzr_completeParents
+    ;;
+
+(remerge)
+    args+=(
+	'--merge-type=[the type of the merge]:type:'
+	'--reprocess[reprocess to reduce spurious conflicts]'
+	'--show-base[show base revision text in conflicts]'
+	)
+    _bzr_completeParents
+    ;;
+
+(conflicts|added|deleted|modified|unknowns|directories|ignored|unbind|nick|revno|version)
+    ;;
+
+(whoami)
+    args+=( '--email[only show e-mail address]' )
+    ;;
+
+(inventory)
+    args+=(
+	'--kind=[limit output by type]:kind:(file directory symlink)'
+	'(-r --revision)'{--revision=,-r}'[show inventory of a revision]:revision:'
+	'--show-ids[show file IDs]'
+	)
+    ;;
+
+(diff|dif|di)
+    args+=(
+	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
+	'--diff-options=[options to pass to gdiff]:diff options:'
+	'(-p --prefix)'{--prefix,-p}'[set prefix added to old and new filenames]'
+	'*:files:_files'
+	)
+    ;;
+
+(export)
+    args+=(
+	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
+	'--format=[format of exported file]:format:(dir tar tgz tbz2)'
+	'--root=[root directory of patch]:_files -/'
+	'*:destination:_files'
+	)
+    ;;
+
+(ignore)
+    args+=( '*:NAME_PATTERN:_bzr_unknownRoot' )
+    ;;
+
+(info)
+    args+=(
+	'(-v --verbose)'{--verbose,-v}'[display more information]'
+	'*:branch:_files -/'
+	)
+    ;;
+
+(testament)
+    args+=(
+	'(-l --long)'{--long,-l}'[use long format]'
+	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
+	'*:branch:_files -/'
+	)
+    ;;
+
+(revert|merge-revert)
+    args+=(
+	'--no-backup[skip generation of backup~ files]'
+	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
+	'*:file:_bzr_versionedFiles'
+	)
+    ;;
+
+(merge)
+    args+=(
+	'--force[ignore uncommitted changes]'
+	'--merge-type:merge type:(diff3 merge3 weave)'
+	'--remember[remember the specified location as a default]'
+	'--reprocess[reprocess to reduce spurious conflicts]'
+	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
+	'--show-base[show base revision text in conflicts]'
+	'*:local repository:_files -/'
+	)
+    _bzr_completeParents
+    ;;
+
+(ls)
+    args+=(
+	'(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]'
+	'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
+	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
+	'--from-root[print all paths from the root of the branch]'
+	'--non-recursive[do not recurse into subdirectories]'
+	'--null[null separate the files]'
+	'--ignored[print ignored files]'
+	'--unknown[print unknown files]'
+	'--versioned[print versioned files]'
+	)
+    ;;
+
+(switch)
+    args+=(
+	'--force[switch even if local commits will be lost]'
+	'(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]'
+	'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
+	'*:local repository:_files -/'
+	)
+    _bzr_completeParents
+    ;;
+
+(help)
+    args=(
+	'(-l --long)'{--long,-l}'[use long format]'
+	'*:subcmds:->cmds'
+	)
+    _arguments -s "$args[@]" && ret=0
+    _describe -t subcommand 'subcommand' _bzr_cmds
+    return 0
+    ;;
+
+    # Plugins
+
+(visualize|visualise|viz|vis)
+    args+=( '(-r --revision)'{--revision=,-r}'[starting revision]:rev:' )
+    ;;
+
+(gannotate|gblame|gpraise)
+    args+=(
+	'--all[show annotations on all lines]'
+	'--plain[do not hightlight annotation lines]'
+	'*:files:_bzr_versionedFiles'
+	)
+    ;;
+
+(push)
+    args+=(
+	'--create-prefix[create the path leading up to the branch when missing]'
+	'--overwrite[ignore differences, overwrite unconditionally]'
+	'--remember[remember the specified location as a default]'
+	'*:local repository:_files -/'
+	)
+    _bzr_completeParents
+    ;;
+
+(clean-tree)
+    args+=(
+	'--dry-run[show files to delete instead of deleting them]'
+	'--ignored[delete all ignored files]'
+	'--detritus[delete conflict files, merge backups, failed self-tests, *~, *.tmp, etc]'
+	)
+    ;;
+
+(uncommit)
+    args+=(
+	'--dry-run[do not make any changes]'
+	'--force[say "yes" to all questions]'
+	'(-r --revision)'{--revision=,-r}'[the earliest revision to delete]:rev:'
+	'(-v --verbose)'{--verbose,-v}'[display more information]'
+	)
+    ;;
+
+(sign-my-commits)
+    args+=( '--dry-run[do not actually sign anything]' )
+    ;;
+
+(*)
+    _message "unknown bzr command completion: $cmd"
+    return 1
+    ;;
+esac
+
+_arguments -s "$args[@]" && ret=0
+return $ret
\ No newline at end of file

=== added file 'zsh_completion/_kde-sc-build-status'
--- zsh_completion/_kde-sc-build-status	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kde-sc-build-status	2011-09-01 14:20:25 +0000
@@ -0,0 +1,2 @@
+#compdef kde-sc-build-status
+_message "no more arguments"
\ No newline at end of file

=== added file 'zsh_completion/_kgetsource'
--- zsh_completion/_kgetsource	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kgetsource	2011-09-01 14:20:25 +0000
@@ -0,0 +1,44 @@
+#compdef kgetsource
+#_arguments '1:name of the package:_getpackages' '2:version of the package:_print_valid_version' '3:series:_series'
+function _name() {
+  if ( [[ ${+_kubuntu_completion_cache_packages} -eq 0 ]] ||
+      _cache_invalid KUBUNTU_PACKAGES_CACHE) && ! _retrieve_cache KUBUNTU_PACKAGES_CACHE;
+  then
+    _kubuntu_completion_cache_packages=(
+      ${(f)"$(kshowbranches| grep "lp:~kubuntu-packagers/kubuntu-packaging/" |sed 's/lp:\~kubuntu-packagers\/kubuntu-packaging\///' 2>/dev/null)"}
+    )
+
+    _store_cache KUBUNTU_PACKAGES_CACHE _kubuntu_completion_cache_packages
+  fi
+  typeset -gH _kubuntu_completion_cache_packages
+  
+  compadd -x "branch name" -a _kubuntu_completion_cache_packages
+}
+
+function _version() {
+  #TODO: This isn’t finished yet
+  __version=('1.0')
+  typeset -gH __version
+  compadd -x "version" -a __version
+}
+
+function _series() {
+  if ( [[ ${+_kubuntu_completion_cache_series} -eq 0 ]] ||
+      _cache_invalid KUBUNTU_SERIES_CACHE) && ! _retrieve_cache KUBUNTU_SERIES_CACHE;
+  then
+    _kubuntu_completion_cache_series=(
+      ${(f)"$(kshowseries 2>/dev/null)"}
+    )
+
+    _store_cache KUBUNTU_SERIES_CACHE _kubuntu_completion_cache_series
+  fi
+  typeset -gH _kubuntu_completion_cache_series
+  compadd -x "series" -a _kubuntu_completion_cache_series
+}
+
+local ret=1
+_arguments \
+    ':package name:_name' \
+    ':version:_version' \
+    ':series:_series' && ret=0
+return ret
\ No newline at end of file

=== added file 'zsh_completion/_klinksource'
--- zsh_completion/_klinksource	1970-01-01 00:00:00 +0000
+++ zsh_completion/_klinksource	2011-09-01 14:20:25 +0000
@@ -0,0 +1,5 @@
+#compdef klinksource
+
+#TODO: make it work
+
+_arguments "1:tar to link:_files -g '*-?*.tar.(gz|bz2|xz|lzma)'"
\ No newline at end of file

=== added file 'zsh_completion/_kshowbranches'
--- zsh_completion/_kshowbranches	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kshowbranches	2011-09-01 14:20:25 +0000
@@ -0,0 +1,2 @@
+#compdef kshowbranches
+_message "no more arguments"
\ No newline at end of file

=== added file 'zsh_completion/_kshowseries'
--- zsh_completion/_kshowseries	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kshowseries	2011-09-01 14:20:25 +0000
@@ -0,0 +1,2 @@
+#compdef kshowseries
+_message "no more arguments"
\ No newline at end of file

=== added file 'zsh_completion/_kubuntu-update-symbols'
--- zsh_completion/_kubuntu-update-symbols	1970-01-01 00:00:00 +0000
+++ zsh_completion/_kubuntu-update-symbols	2011-09-01 14:20:25 +0000
@@ -0,0 +1,2 @@
+#compdef kubuntu-update-symbols
+_message "no more arguments"
\ No newline at end of file

-- 
kubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/kubuntu-devel

Reply via email to