@@ -1,11 +1,11 @@ | |||
# Generated by makepkg 4.2.0 | |||
# using fakeroot version 1.20.2 | |||
# Wed Jan 21 19:59:32 UTC 2015 | |||
# Wed Jan 28 21:55:43 UTC 2015 | |||
pkgname = drive | |||
pkgver = 0.0.7-1 | |||
pkgdesc = Pull or push Google Drive files | |||
url = http://github.com/odeke-em/drive | |||
builddate = 1421870372 | |||
builddate = 1422482143 | |||
packager = Unknown Packager | |||
size = 8358912 | |||
arch = x86_64 |
@@ -0,0 +1,51 @@ | |||
# Maintainer: John Jenkins twodopeshaggy@gmail.com | |||
pkgname=ssh-chat-git | |||
epoch=1 | |||
pkgver=0.288.6c893a8 | |||
pkgrel=1 | |||
pkgdesc="A command line tool for chating over SSH" | |||
arch=('i686' 'x86_64') | |||
url="https://github.com/shazow/ssh-chat" | |||
license=('MIT') | |||
makedepends=('go' 'git') | |||
source=( | |||
'git+git://github.com/shazow/ssh-chat.git' | |||
) | |||
sha256sums=( | |||
'SKIP' | |||
) | |||
_gitname="ssh-chat" | |||
pkgver() { | |||
cd "${srcdir}/${_gitname}" | |||
echo "0.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" | |||
} | |||
prepare(){ | |||
mkdir -p "$srcdir/go" | |||
export GOPATH="$srcdir/go" | |||
go get golang.org/x/crypto/ssh | |||
go get code.google.com/p/gopass | |||
go get github.com/alexcesaro/log | |||
go get github.com/alexcesaro/log/golog | |||
go get github.com/jessevdk/go-flags | |||
go get github.com/shazow/ssh-chat | |||
go get github.com/shazow/ssh-chat/chat | |||
go get github.com/shazow/ssh-chat/chat/message | |||
go get github.com/shazow/ssh-chat/sshd | |||
} | |||
build() { | |||
cd "${srcdir}/${_gitname}" | |||
make build | |||
} | |||
package() { | |||
cd "${srcdir}/${_gitname}" | |||
install -D ssh-chat "${pkgdir}/usr/bin/ssh-chat" | |||
} |
@@ -0,0 +1,25 @@ | |||
# Maintainer: John "ShaggyTwoDope" Jenkins <twodopeshaggy at gmail dot com> | |||
pkgname=ssh-chat-git | |||
pkgver=0.2.3 | |||
pkgrel=1 | |||
pkgdesc="Terminal Image Renderer" | |||
arch=('i686' 'x86_64') | |||
url=https://github.com/shazow/ssh-chat | |||
license=(GPL3) | |||
makedepends=('go') | |||
source=("git+git://github.com/shazow/ssh-chat") | |||
sha256sums=("SKIP") | |||
build() { | |||
export GOPATH="${srcdir}/godir" | |||
mkdir -p "$GOPATH" | |||
cd "${srcdir}/${pkgname}-${pkgver}" | |||
make | |||
} | |||
package() { | |||
cd "${srcdir}/${pkgname}-${pkgver}" | |||
install -D tir "${pkgdir}/usr/bin/tir" | |||
} | |||
@@ -0,0 +1,23 @@ | |||
# Generated by makepkg 4.2.0 | |||
# using fakeroot version 1.20.2 | |||
# Fri Jan 30 12:54:32 UTC 2015 | |||
pkgname = ssh-chat-git | |||
pkgver = 1:0.288.6c893a8-1 | |||
pkgdesc = A command line tool for chating over SSH | |||
url = https://github.com/shazow/ssh-chat | |||
builddate = 1422622472 | |||
packager = Unknown Packager | |||
size = 6775808 | |||
arch = x86_64 | |||
license = MIT | |||
makedepend = go | |||
makedepend = git | |||
makepkgopt = strip | |||
makepkgopt = docs | |||
makepkgopt = !libtool | |||
makepkgopt = !staticlibs | |||
makepkgopt = emptydirs | |||
makepkgopt = zipman | |||
makepkgopt = purge | |||
makepkgopt = !upx | |||
makepkgopt = !debug |
@@ -0,0 +1,83 @@ | |||
24b95fa863c6b9239bc34dfa69ea3480a75974be not-for-merge branch 'highlight-on-beep' of git://github.com/shazow/ssh-chat | |||
6c893a8c2a2f34826532b5872dcff52ac7adb4c3 not-for-merge branch 'master' of git://github.com/shazow/ssh-chat | |||
bb1d568b38b938f64c77dde51a079ffbd545af24 not-for-merge branch 'message-package' of git://github.com/shazow/ssh-chat | |||
3d307ac686a32f2f1bc2394510e7bcc1fd517d22 not-for-merge branch 'ratelimit-fix' of git://github.com/shazow/ssh-chat | |||
8188deef3072be266f14801124f0d0c8cbcc4496 not-for-merge branch 'sshchat-package' of git://github.com/shazow/ssh-chat | |||
e12982d2ba6a9aa5c71459e17ab0eb020cd055d3 not-for-merge branch 'v0' of git://github.com/shazow/ssh-chat | |||
4128c4279ae1dace13b65f8e719d3b8fd001f4c8 not-for-merge 'refs/pull/1/head' of git://github.com/shazow/ssh-chat | |||
70f0936e45e30bc2288a783e7e43ba5640ef98a7 not-for-merge 'refs/pull/10/head' of git://github.com/shazow/ssh-chat | |||
a79ba49ed42108f09f23823841da7c48b548f9fa not-for-merge 'refs/pull/10/merge' of git://github.com/shazow/ssh-chat | |||
1417c8af14cc31666c207723f2fc6dbe07caae63 not-for-merge 'refs/pull/100/head' of git://github.com/shazow/ssh-chat | |||
59789bd36e341915b5538947fa53921e549c3f90 not-for-merge 'refs/pull/101/head' of git://github.com/shazow/ssh-chat | |||
cc42f0aa7a9434c38836a1e3e1e47995acc7ce33 not-for-merge 'refs/pull/106/head' of git://github.com/shazow/ssh-chat | |||
492d50d521679d3dd135ee531dc4caaee3df36ee not-for-merge 'refs/pull/109/head' of git://github.com/shazow/ssh-chat | |||
273b61c21b85e1ef92ab26b67c8902910303a03e not-for-merge 'refs/pull/11/head' of git://github.com/shazow/ssh-chat | |||
98e57c61d5a8837fb945fb40ad08b433862b1a4c not-for-merge 'refs/pull/112/head' of git://github.com/shazow/ssh-chat | |||
bb1d568b38b938f64c77dde51a079ffbd545af24 not-for-merge 'refs/pull/119/head' of git://github.com/shazow/ssh-chat | |||
4227e0d8d47c97cfb81eb39b24b5c9e6a60e98f1 not-for-merge 'refs/pull/12/head' of git://github.com/shazow/ssh-chat | |||
8188deef3072be266f14801124f0d0c8cbcc4496 not-for-merge 'refs/pull/121/head' of git://github.com/shazow/ssh-chat | |||
3d307ac686a32f2f1bc2394510e7bcc1fd517d22 not-for-merge 'refs/pull/122/head' of git://github.com/shazow/ssh-chat | |||
c28e5b38b16e078b00134c18d8d5d3d7ab5a8609 not-for-merge 'refs/pull/13/head' of git://github.com/shazow/ssh-chat | |||
72ab7fade2a594ff95bca9bb44a38cb2a19dc484 not-for-merge 'refs/pull/15/head' of git://github.com/shazow/ssh-chat | |||
798e36198098e690ee5fac20174f73fa7d847221 not-for-merge 'refs/pull/16/head' of git://github.com/shazow/ssh-chat | |||
13043e9a6093115aba7f1c295bf577e58e4ba873 not-for-merge 'refs/pull/18/head' of git://github.com/shazow/ssh-chat | |||
4219146406d4815e036f009f1bd1dc2758895d27 not-for-merge 'refs/pull/2/head' of git://github.com/shazow/ssh-chat | |||
967106780cd7fabf35c62f71496e851cfd1f763e not-for-merge 'refs/pull/20/head' of git://github.com/shazow/ssh-chat | |||
c34a0fc557d79421ddb1b38420b4079f0031935b not-for-merge 'refs/pull/20/merge' of git://github.com/shazow/ssh-chat | |||
0ece568c4ff1425320e44542666aee7737069ffd not-for-merge 'refs/pull/21/head' of git://github.com/shazow/ssh-chat | |||
928f9ca4efe7a75a9f8dad3f480aec0993995a3c not-for-merge 'refs/pull/26/head' of git://github.com/shazow/ssh-chat | |||
8644d8c6207d3ad9841288f53674397f3345463a not-for-merge 'refs/pull/29/head' of git://github.com/shazow/ssh-chat | |||
ae21832186cdf84aa0b0e93104d78f6afb6627bf not-for-merge 'refs/pull/29/merge' of git://github.com/shazow/ssh-chat | |||
d22e80d2c1d7bbd5bf7711d51ea24fbc3b9b1593 not-for-merge 'refs/pull/3/head' of git://github.com/shazow/ssh-chat | |||
20f63734da3ba7b81146a7620cf6383a4505ddaf not-for-merge 'refs/pull/31/head' of git://github.com/shazow/ssh-chat | |||
53b320937652821c087098eae48241aecec6ca58 not-for-merge 'refs/pull/31/merge' of git://github.com/shazow/ssh-chat | |||
171f0da9aa87819546b2f9bb2356ee187211ec02 not-for-merge 'refs/pull/32/head' of git://github.com/shazow/ssh-chat | |||
79eb6b4388000c572a4fe2916403600a2c827b24 not-for-merge 'refs/pull/33/head' of git://github.com/shazow/ssh-chat | |||
b5636dba9dc78af25eee8ba7ae71430431383335 not-for-merge 'refs/pull/34/head' of git://github.com/shazow/ssh-chat | |||
90183ea6474b2f2bbad5f51dbf721ed83d46b5c7 not-for-merge 'refs/pull/35/head' of git://github.com/shazow/ssh-chat | |||
719c45d563ea8e36600e82918d31d37bc30215b7 not-for-merge 'refs/pull/35/merge' of git://github.com/shazow/ssh-chat | |||
b909710b5914c7f816bb5e1c1f09f62ceca82e6d not-for-merge 'refs/pull/36/head' of git://github.com/shazow/ssh-chat | |||
12a174ded865824122047bf0ea51c4525e536329 not-for-merge 'refs/pull/38/head' of git://github.com/shazow/ssh-chat | |||
ef8bdebb1e14e760095940f1d7ec248ba28d1353 not-for-merge 'refs/pull/38/merge' of git://github.com/shazow/ssh-chat | |||
271c0aa082551229c6a33cab9a95934f19c7a81c not-for-merge 'refs/pull/39/head' of git://github.com/shazow/ssh-chat | |||
ee23c1617ad96cbed4c9f48d0c98dbf640810e0e not-for-merge 'refs/pull/4/head' of git://github.com/shazow/ssh-chat | |||
95ccbe2922e2a814282b2939440d37533c80ce83 not-for-merge 'refs/pull/41/head' of git://github.com/shazow/ssh-chat | |||
75fa10e61810568ad0c290b068cebb64ed91f090 not-for-merge 'refs/pull/42/head' of git://github.com/shazow/ssh-chat | |||
97c0ed50b82350bec82b1993ff1c44101507c899 not-for-merge 'refs/pull/42/merge' of git://github.com/shazow/ssh-chat | |||
ada86b2a53f2d9f40244679cb321fad341911448 not-for-merge 'refs/pull/44/head' of git://github.com/shazow/ssh-chat | |||
84b0b5ab162660cfdd2b71e49af509683ef93bde not-for-merge 'refs/pull/45/head' of git://github.com/shazow/ssh-chat | |||
f07f7e78ab31b60108bd416cc99ca12457f247be not-for-merge 'refs/pull/5/head' of git://github.com/shazow/ssh-chat | |||
49accaa785bdf9f5049de6291ec4ec3fba306272 not-for-merge 'refs/pull/50/head' of git://github.com/shazow/ssh-chat | |||
ca979b9e72287bd2482651e737291aea50244b3f not-for-merge 'refs/pull/51/head' of git://github.com/shazow/ssh-chat | |||
50f1dc811c9fced81aa03d46e0a1114e1e906dcc not-for-merge 'refs/pull/52/head' of git://github.com/shazow/ssh-chat | |||
e94838dbe85dbe92633b2f8a67020ef04433dcee not-for-merge 'refs/pull/53/head' of git://github.com/shazow/ssh-chat | |||
7d8e5146b11dcddd2d528566ea4e61380789bfe7 not-for-merge 'refs/pull/54/head' of git://github.com/shazow/ssh-chat | |||
120cd8aae81fec39255ef8eef001752138407756 not-for-merge 'refs/pull/55/head' of git://github.com/shazow/ssh-chat | |||
dd65f7faf243256aedce22135279ec8c1df120fc not-for-merge 'refs/pull/56/head' of git://github.com/shazow/ssh-chat | |||
cf0efed63941448072c91778f710efb753c67ec6 not-for-merge 'refs/pull/59/head' of git://github.com/shazow/ssh-chat | |||
6d8d533bed6935411ce700b52ee3a0b3fbd2f20f not-for-merge 'refs/pull/6/head' of git://github.com/shazow/ssh-chat | |||
7634d0b170df6bfda41f32e8c66bb75f6144bf69 not-for-merge 'refs/pull/60/head' of git://github.com/shazow/ssh-chat | |||
a52d7745602632213c08ff8778c1a86340c297ca not-for-merge 'refs/pull/60/merge' of git://github.com/shazow/ssh-chat | |||
24b95fa863c6b9239bc34dfa69ea3480a75974be not-for-merge 'refs/pull/61/head' of git://github.com/shazow/ssh-chat | |||
cf71f1419a70edf98aca48c57fd1c47b4b7b77ae not-for-merge 'refs/pull/61/merge' of git://github.com/shazow/ssh-chat | |||
2b90eab1d5a15f965764b07c0179ba02b14729e9 not-for-merge 'refs/pull/62/head' of git://github.com/shazow/ssh-chat | |||
281dafa817215d76b58a1c5f70eb80f6f92dc034 not-for-merge 'refs/pull/64/head' of git://github.com/shazow/ssh-chat | |||
f9e4e9f88f7632eb417b9f233588ac14e99fa971 not-for-merge 'refs/pull/65/head' of git://github.com/shazow/ssh-chat | |||
84ff8ea4e753aff016d8f9690392197370b21ecc not-for-merge 'refs/pull/67/head' of git://github.com/shazow/ssh-chat | |||
ae9d08733bbddf5a73177049c8a23e5f41f4c9b8 not-for-merge 'refs/pull/67/merge' of git://github.com/shazow/ssh-chat | |||
23b98fcf31b25564d0e40e1319ce99acf48b1bba not-for-merge 'refs/pull/68/head' of git://github.com/shazow/ssh-chat | |||
e520a1758f0501399153b7d43406e38d77ef3212 not-for-merge 'refs/pull/68/merge' of git://github.com/shazow/ssh-chat | |||
1afe84925de95b4d3668dc78fd689e17f88b4ac0 not-for-merge 'refs/pull/69/head' of git://github.com/shazow/ssh-chat | |||
2ae9f0c8e72090b3402caafaa5dc910077993cef not-for-merge 'refs/pull/7/head' of git://github.com/shazow/ssh-chat | |||
15a5052c33579feaa6c9a533c33055d62572ce18 not-for-merge 'refs/pull/70/head' of git://github.com/shazow/ssh-chat | |||
68e82ff1155d54e6b752f3394a7e56567f4262d7 not-for-merge 'refs/pull/72/head' of git://github.com/shazow/ssh-chat | |||
d9e0f658d820aac83f691466d7d548295ec1c41b not-for-merge 'refs/pull/77/head' of git://github.com/shazow/ssh-chat | |||
a160bc9bac48cbd009e6a9c98c48a1e14221f3f2 not-for-merge 'refs/pull/79/head' of git://github.com/shazow/ssh-chat | |||
9127234acf155fc159d0f6dea212db0aa6b8eb6a not-for-merge 'refs/pull/84/head' of git://github.com/shazow/ssh-chat | |||
28470aa7b7ef4683825765c3b51496775ebe87c4 not-for-merge 'refs/pull/85/head' of git://github.com/shazow/ssh-chat | |||
c4ffd6f26373f9d49c36aaca6ff9a5e814d58af5 not-for-merge 'refs/pull/87/head' of git://github.com/shazow/ssh-chat | |||
d643d61ccc0adc8884ec9e946ca8e0140ed28151 not-for-merge 'refs/pull/95/head' of git://github.com/shazow/ssh-chat | |||
6d023fbe26a6f0190588e55fd0068997ca837c1f not-for-merge 'refs/pull/95/merge' of git://github.com/shazow/ssh-chat | |||
a2ee2000bbe7a7b44f475caf09feecb2cd424c9b not-for-merge 'refs/pull/96/head' of git://github.com/shazow/ssh-chat | |||
e29540c73b41bdaab8b0ea0b916730ccd196acd4 not-for-merge 'refs/pull/97/head' of git://github.com/shazow/ssh-chat | |||
23d06faa6830625806048865e1937dcfed20c927 not-for-merge 'refs/pull/98/head' of git://github.com/shazow/ssh-chat |
@@ -0,0 +1 @@ | |||
ref: refs/heads/master |
@@ -0,0 +1,8 @@ | |||
[core] | |||
repositoryformatversion = 0 | |||
filemode = true | |||
bare = true | |||
[remote "origin"] | |||
url = git://github.com/shazow/ssh-chat.git | |||
fetch = +refs/*:refs/* | |||
mirror = true |
@@ -0,0 +1 @@ | |||
Unnamed repository; edit this file 'description' to name the repository. |
@@ -0,0 +1,15 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to check the commit log message taken by | |||
# applypatch from an e-mail message. | |||
# | |||
# The hook should exit with non-zero status after issuing an | |||
# appropriate message if it wants to stop the commit. The hook is | |||
# allowed to edit the commit message file. | |||
# | |||
# To enable this hook, rename this file to "applypatch-msg". | |||
. git-sh-setup | |||
test -x "$GIT_DIR/hooks/commit-msg" && | |||
exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} | |||
: |
@@ -0,0 +1,24 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to check the commit log message. | |||
# Called by "git commit" with one argument, the name of the file | |||
# that has the commit message. The hook should exit with non-zero | |||
# status after issuing an appropriate message if it wants to stop the | |||
# commit. The hook is allowed to edit the commit message file. | |||
# | |||
# To enable this hook, rename this file to "commit-msg". | |||
# Uncomment the below to add a Signed-off-by line to the message. | |||
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg | |||
# hook is more suited to it. | |||
# | |||
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') | |||
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" | |||
# This example catches duplicate Signed-off-by lines. | |||
test "" = "$(grep '^Signed-off-by: ' "$1" | | |||
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { | |||
echo >&2 Duplicate Signed-off-by lines. | |||
exit 1 | |||
} |
@@ -0,0 +1,8 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to prepare a packed repository for use over | |||
# dumb transports. | |||
# | |||
# To enable this hook, rename this file to "post-update". | |||
exec git update-server-info |
@@ -0,0 +1,14 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to verify what is about to be committed | |||
# by applypatch from an e-mail message. | |||
# | |||
# The hook should exit with non-zero status after issuing an | |||
# appropriate message if it wants to stop the commit. | |||
# | |||
# To enable this hook, rename this file to "pre-applypatch". | |||
. git-sh-setup | |||
test -x "$GIT_DIR/hooks/pre-commit" && | |||
exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} | |||
: |
@@ -0,0 +1,49 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to verify what is about to be committed. | |||
# Called by "git commit" with no arguments. The hook should | |||
# exit with non-zero status after issuing an appropriate message if | |||
# it wants to stop the commit. | |||
# | |||
# To enable this hook, rename this file to "pre-commit". | |||
if git rev-parse --verify HEAD >/dev/null 2>&1 | |||
then | |||
against=HEAD | |||
else | |||
# Initial commit: diff against an empty tree object | |||
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |||
fi | |||
# If you want to allow non-ASCII filenames set this variable to true. | |||
allownonascii=$(git config --bool hooks.allownonascii) | |||
# Redirect output to stderr. | |||
exec 1>&2 | |||
# Cross platform projects tend to avoid non-ASCII filenames; prevent | |||
# them from being added to the repository. We exploit the fact that the | |||
# printable range starts at the space character and ends with tilde. | |||
if [ "$allownonascii" != "true" ] && | |||
# Note that the use of brackets around a tr range is ok here, (it's | |||
# even required, for portability to Solaris 10's /usr/bin/tr), since | |||
# the square bracket bytes happen to fall in the designated range. | |||
test $(git diff --cached --name-only --diff-filter=A -z $against | | |||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 | |||
then | |||
cat <<\EOF | |||
Error: Attempt to add a non-ASCII file name. | |||
This can cause problems if you want to work with people on other platforms. | |||
To be portable it is advisable to rename the file. | |||
If you know what you are doing you can disable this check using: | |||
git config hooks.allownonascii true | |||
EOF | |||
exit 1 | |||
fi | |||
# If there are whitespace errors, print the offending file names and fail. | |||
exec git diff-index --check --cached $against -- |
@@ -0,0 +1,54 @@ | |||
#!/bin/sh | |||
# An example hook script to verify what is about to be pushed. Called by "git | |||
# push" after it has checked the remote status, but before anything has been | |||
# pushed. If this script exits with a non-zero status nothing will be pushed. | |||
# | |||
# This hook is called with the following parameters: | |||
# | |||
# $1 -- Name of the remote to which the push is being done | |||
# $2 -- URL to which the push is being done | |||
# | |||
# If pushing without using a named remote those arguments will be equal. | |||
# | |||
# Information about the commits which are being pushed is supplied as lines to | |||
# the standard input in the form: | |||
# | |||
# <local ref> <local sha1> <remote ref> <remote sha1> | |||
# | |||
# This sample shows how to prevent push of commits where the log message starts | |||
# with "WIP" (work in progress). | |||
remote="$1" | |||
url="$2" | |||
z40=0000000000000000000000000000000000000000 | |||
IFS=' ' | |||
while read local_ref local_sha remote_ref remote_sha | |||
do | |||
if [ "$local_sha" = $z40 ] | |||
then | |||
# Handle delete | |||
: | |||
else | |||
if [ "$remote_sha" = $z40 ] | |||
then | |||
# New branch, examine all commits | |||
range="$local_sha" | |||
else | |||
# Update to existing branch, examine new commits | |||
range="$remote_sha..$local_sha" | |||
fi | |||
# Check for WIP commit | |||
commit=`git rev-list -n 1 --grep '^WIP' "$range"` | |||
if [ -n "$commit" ] | |||
then | |||
echo >&2 "Found WIP commit in $local_ref, not pushing" | |||
exit 1 | |||
fi | |||
fi | |||
done | |||
exit 0 |
@@ -0,0 +1,169 @@ | |||
#!/bin/sh | |||
# | |||
# Copyright (c) 2006, 2008 Junio C Hamano | |||
# | |||
# The "pre-rebase" hook is run just before "git rebase" starts doing | |||
# its job, and can prevent the command from running by exiting with | |||
# non-zero status. | |||
# | |||
# The hook is called with the following parameters: | |||
# | |||
# $1 -- the upstream the series was forked from. | |||
# $2 -- the branch being rebased (or empty when rebasing the current branch). | |||
# | |||
# This sample shows how to prevent topic branches that are already | |||
# merged to 'next' branch from getting rebased, because allowing it | |||
# would result in rebasing already published history. | |||
publish=next | |||
basebranch="$1" | |||
if test "$#" = 2 | |||
then | |||
topic="refs/heads/$2" | |||
else | |||
topic=`git symbolic-ref HEAD` || | |||
exit 0 ;# we do not interrupt rebasing detached HEAD | |||
fi | |||
case "$topic" in | |||
refs/heads/??/*) | |||
;; | |||
*) | |||
exit 0 ;# we do not interrupt others. | |||
;; | |||
esac | |||
# Now we are dealing with a topic branch being rebased | |||
# on top of master. Is it OK to rebase it? | |||
# Does the topic really exist? | |||
git show-ref -q "$topic" || { | |||
echo >&2 "No such branch $topic" | |||
exit 1 | |||
} | |||
# Is topic fully merged to master? | |||
not_in_master=`git rev-list --pretty=oneline ^master "$topic"` | |||
if test -z "$not_in_master" | |||
then | |||
echo >&2 "$topic is fully merged to master; better remove it." | |||
exit 1 ;# we could allow it, but there is no point. | |||
fi | |||
# Is topic ever merged to next? If so you should not be rebasing it. | |||
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` | |||
only_next_2=`git rev-list ^master ${publish} | sort` | |||
if test "$only_next_1" = "$only_next_2" | |||
then | |||
not_in_topic=`git rev-list "^$topic" master` | |||
if test -z "$not_in_topic" | |||
then | |||
echo >&2 "$topic is already up-to-date with master" | |||
exit 1 ;# we could allow it, but there is no point. | |||
else | |||
exit 0 | |||
fi | |||
else | |||
not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` | |||
/usr/bin/perl -e ' | |||
my $topic = $ARGV[0]; | |||
my $msg = "* $topic has commits already merged to public branch:\n"; | |||
my (%not_in_next) = map { | |||
/^([0-9a-f]+) /; | |||
($1 => 1); | |||
} split(/\n/, $ARGV[1]); | |||
for my $elem (map { | |||
/^([0-9a-f]+) (.*)$/; | |||
[$1 => $2]; | |||
} split(/\n/, $ARGV[2])) { | |||
if (!exists $not_in_next{$elem->[0]}) { | |||
if ($msg) { | |||
print STDERR $msg; | |||
undef $msg; | |||
} | |||
print STDERR " $elem->[1]\n"; | |||
} | |||
} | |||
' "$topic" "$not_in_next" "$not_in_master" | |||
exit 1 | |||
fi | |||
exit 0 | |||
################################################################ | |||
This sample hook safeguards topic branches that have been | |||
published from being rewound. | |||
The workflow assumed here is: | |||
* Once a topic branch forks from "master", "master" is never | |||
merged into it again (either directly or indirectly). | |||
* Once a topic branch is fully cooked and merged into "master", | |||
it is deleted. If you need to build on top of it to correct | |||
earlier mistakes, a new topic branch is created by forking at | |||
the tip of the "master". This is not strictly necessary, but | |||
it makes it easier to keep your history simple. | |||
* Whenever you need to test or publish your changes to topic | |||
branches, merge them into "next" branch. | |||
The script, being an example, hardcodes the publish branch name | |||
to be "next", but it is trivial to make it configurable via | |||
$GIT_DIR/config mechanism. | |||
With this workflow, you would want to know: | |||
(1) ... if a topic branch has ever been merged to "next". Young | |||
topic branches can have stupid mistakes you would rather | |||
clean up before publishing, and things that have not been | |||
merged into other branches can be easily rebased without | |||
affecting other people. But once it is published, you would | |||
not want to rewind it. | |||
(2) ... if a topic branch has been fully merged to "master". | |||
Then you can delete it. More importantly, you should not | |||
build on top of it -- other people may already want to | |||
change things related to the topic as patches against your | |||
"master", so if you need further changes, it is better to | |||
fork the topic (perhaps with the same name) afresh from the | |||
tip of "master". | |||
Let's look at this example: | |||
o---o---o---o---o---o---o---o---o---o "next" | |||
/ / / / | |||
/ a---a---b A / / | |||
/ / / / | |||
/ / c---c---c---c B / | |||
/ / / \ / | |||
/ / / b---b C \ / | |||
/ / / / \ / | |||
---o---o---o---o---o---o---o---o---o---o---o "master" | |||
A, B and C are topic branches. | |||
* A has one fix since it was merged up to "next". | |||
* B has finished. It has been fully merged up to "master" and "next", | |||
and is ready to be deleted. | |||
* C has not merged to "next" at all. | |||
We would want to allow C to be rebased, refuse A, and encourage | |||
B to be deleted. | |||
To compute (1): | |||
git rev-list ^master ^topic next | |||
git rev-list ^master next | |||
if these match, topic has not merged in next at all. | |||
To compute (2): | |||
git rev-list master..topic | |||
if this is empty, it is fully merged to "master". |
@@ -0,0 +1,36 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to prepare the commit log message. | |||
# Called by "git commit" with the name of the file that has the | |||
# commit message, followed by the description of the commit | |||
# message's source. The hook's purpose is to edit the commit | |||
# message file. If the hook fails with a non-zero status, | |||
# the commit is aborted. | |||
# | |||
# To enable this hook, rename this file to "prepare-commit-msg". | |||
# This hook includes three examples. The first comments out the | |||
# "Conflicts:" part of a merge commit. | |||
# | |||
# The second includes the output of "git diff --name-status -r" | |||
# into the message, just before the "git status" output. It is | |||
# commented because it doesn't cope with --amend or with squashed | |||
# commits. | |||
# | |||
# The third example adds a Signed-off-by line to the message, that can | |||
# still be edited. This is rarely a good idea. | |||
case "$2,$3" in | |||
merge,) | |||
/usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; | |||
# ,|template,) | |||
# /usr/bin/perl -i.bak -pe ' | |||
# print "\n" . `git diff --cached --name-status -r` | |||
# if /^#/ && $first++ == 0' "$1" ;; | |||
*) ;; | |||
esac | |||
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') | |||
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" |
@@ -0,0 +1,128 @@ | |||
#!/bin/sh | |||
# | |||
# An example hook script to blocks unannotated tags from entering. | |||
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new | |||
# | |||
# To enable this hook, rename this file to "update". | |||
# | |||
# Config | |||
# ------ | |||
# hooks.allowunannotated | |||
# This boolean sets whether unannotated tags will be allowed into the | |||
# repository. By default they won't be. | |||
# hooks.allowdeletetag | |||
# This boolean sets whether deleting tags will be allowed in the | |||
# repository. By default they won't be. | |||
# hooks.allowmodifytag | |||
# This boolean sets whether a tag may be modified after creation. By default | |||
# it won't be. | |||
# hooks.allowdeletebranch | |||
# This boolean sets whether deleting branches will be allowed in the | |||
# repository. By default they won't be. | |||
# hooks.denycreatebranch | |||
# This boolean sets whether remotely creating branches will be denied | |||
# in the repository. By default this is allowed. | |||
# | |||
# --- Command line | |||
refname="$1" | |||
oldrev="$2" | |||
newrev="$3" | |||
# --- Safety check | |||
if [ -z "$GIT_DIR" ]; then | |||
echo "Don't run this script from the command line." >&2 | |||
echo " (if you want, you could supply GIT_DIR then run" >&2 | |||
echo " $0 <ref> <oldrev> <newrev>)" >&2 | |||
exit 1 | |||
fi | |||
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then | |||
echo "usage: $0 <ref> <oldrev> <newrev>" >&2 | |||
exit 1 | |||
fi | |||
# --- Config | |||
allowunannotated=$(git config --bool hooks.allowunannotated) | |||
allowdeletebranch=$(git config --bool hooks.allowdeletebranch) | |||
denycreatebranch=$(git config --bool hooks.denycreatebranch) | |||
allowdeletetag=$(git config --bool hooks.allowdeletetag) | |||
allowmodifytag=$(git config --bool hooks.allowmodifytag) | |||
# check for no description | |||
projectdesc=$(sed -e '1q' "$GIT_DIR/description") | |||
case "$projectdesc" in | |||
"Unnamed repository"* | "") | |||
echo "*** Project description file hasn't been set" >&2 | |||
exit 1 | |||
;; | |||
esac | |||
# --- Check types | |||
# if $newrev is 0000...0000, it's a commit to delete a ref. | |||
zero="0000000000000000000000000000000000000000" | |||
if [ "$newrev" = "$zero" ]; then | |||
newrev_type=delete | |||
else | |||
newrev_type=$(git cat-file -t $newrev) | |||
fi | |||
case "$refname","$newrev_type" in | |||
refs/tags/*,commit) | |||
# un-annotated tag | |||
short_refname=${refname##refs/tags/} | |||
if [ "$allowunannotated" != "true" ]; then | |||
echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 | |||
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 | |||
exit 1 | |||
fi | |||
;; | |||
refs/tags/*,delete) | |||
# delete tag | |||
if [ "$allowdeletetag" != "true" ]; then | |||
echo "*** Deleting a tag is not allowed in this repository" >&2 | |||
exit 1 | |||
fi | |||
;; | |||
refs/tags/*,tag) | |||
# annotated tag | |||
if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 | |||
then | |||
echo "*** Tag '$refname' already exists." >&2 | |||
echo "*** Modifying a tag is not allowed in this repository." >&2 | |||
exit 1 | |||
fi | |||
;; | |||
refs/heads/*,commit) | |||
# branch | |||
if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then | |||
echo "*** Creating a branch is not allowed in this repository" >&2 | |||
exit 1 | |||
fi | |||
;; | |||
refs/heads/*,delete) | |||
# delete branch | |||
if [ "$allowdeletebranch" != "true" ]; then | |||
echo "*** Deleting a branch is not allowed in this repository" >&2 | |||
exit 1 | |||
fi | |||
;; | |||
refs/remotes/*,commit) | |||
# tracking branch | |||
;; | |||
refs/remotes/*,delete) | |||
# delete tracking branch | |||
if [ "$allowdeletebranch" != "true" ]; then | |||
echo "*** Deleting a tracking branch is not allowed in this repository" >&2 | |||
exit 1 | |||
fi | |||
;; | |||
*) | |||
# Anything else (is there anything else?) | |||
echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 | |||
exit 1 | |||
;; | |||
esac | |||
# --- Finished | |||
exit 0 |
@@ -0,0 +1,6 @@ | |||
# git ls-files --others --exclude-from=.git/info/exclude | |||
# Lines that start with '#' are comments. | |||
# For a project mostly in C, the following would be a good set of | |||
# exclude patterns (uncomment them if you want to use them): | |||
# *.[oa] | |||
# *~ |
@@ -0,0 +1,84 @@ | |||
# pack-refs with: peeled fully-peeled | |||
24b95fa863c6b9239bc34dfa69ea3480a75974be refs/heads/highlight-on-beep | |||
6c893a8c2a2f34826532b5872dcff52ac7adb4c3 refs/heads/master | |||
bb1d568b38b938f64c77dde51a079ffbd545af24 refs/heads/message-package | |||
3d307ac686a32f2f1bc2394510e7bcc1fd517d22 refs/heads/ratelimit-fix | |||
8188deef3072be266f14801124f0d0c8cbcc4496 refs/heads/sshchat-package | |||
e12982d2ba6a9aa5c71459e17ab0eb020cd055d3 refs/heads/v0 | |||
4128c4279ae1dace13b65f8e719d3b8fd001f4c8 refs/pull/1/head | |||
70f0936e45e30bc2288a783e7e43ba5640ef98a7 refs/pull/10/head | |||
a79ba49ed42108f09f23823841da7c48b548f9fa refs/pull/10/merge | |||
1417c8af14cc31666c207723f2fc6dbe07caae63 refs/pull/100/head | |||
59789bd36e341915b5538947fa53921e549c3f90 refs/pull/101/head | |||
cc42f0aa7a9434c38836a1e3e1e47995acc7ce33 refs/pull/106/head | |||
492d50d521679d3dd135ee531dc4caaee3df36ee refs/pull/109/head | |||
273b61c21b85e1ef92ab26b67c8902910303a03e refs/pull/11/head | |||
98e57c61d5a8837fb945fb40ad08b433862b1a4c refs/pull/112/head | |||
bb1d568b38b938f64c77dde51a079ffbd545af24 refs/pull/119/head | |||
4227e0d8d47c97cfb81eb39b24b5c9e6a60e98f1 refs/pull/12/head | |||
8188deef3072be266f14801124f0d0c8cbcc4496 refs/pull/121/head | |||
3d307ac686a32f2f1bc2394510e7bcc1fd517d22 refs/pull/122/head | |||
c28e5b38b16e078b00134c18d8d5d3d7ab5a8609 refs/pull/13/head | |||
72ab7fade2a594ff95bca9bb44a38cb2a19dc484 refs/pull/15/head | |||
798e36198098e690ee5fac20174f73fa7d847221 refs/pull/16/head | |||
13043e9a6093115aba7f1c295bf577e58e4ba873 refs/pull/18/head | |||
4219146406d4815e036f009f1bd1dc2758895d27 refs/pull/2/head | |||
967106780cd7fabf35c62f71496e851cfd1f763e refs/pull/20/head | |||
c34a0fc557d79421ddb1b38420b4079f0031935b refs/pull/20/merge | |||
0ece568c4ff1425320e44542666aee7737069ffd refs/pull/21/head | |||
928f9ca4efe7a75a9f8dad3f480aec0993995a3c refs/pull/26/head | |||
8644d8c6207d3ad9841288f53674397f3345463a refs/pull/29/head | |||
ae21832186cdf84aa0b0e93104d78f6afb6627bf refs/pull/29/merge | |||
d22e80d2c1d7bbd5bf7711d51ea24fbc3b9b1593 refs/pull/3/head | |||
20f63734da3ba7b81146a7620cf6383a4505ddaf refs/pull/31/head | |||
53b320937652821c087098eae48241aecec6ca58 refs/pull/31/merge | |||
171f0da9aa87819546b2f9bb2356ee187211ec02 refs/pull/32/head | |||
79eb6b4388000c572a4fe2916403600a2c827b24 refs/pull/33/head | |||
b5636dba9dc78af25eee8ba7ae71430431383335 refs/pull/34/head | |||
90183ea6474b2f2bbad5f51dbf721ed83d46b5c7 refs/pull/35/head | |||
719c45d563ea8e36600e82918d31d37bc30215b7 refs/pull/35/merge | |||
b909710b5914c7f816bb5e1c1f09f62ceca82e6d refs/pull/36/head | |||
12a174ded865824122047bf0ea51c4525e536329 refs/pull/38/head | |||
ef8bdebb1e14e760095940f1d7ec248ba28d1353 refs/pull/38/merge | |||
271c0aa082551229c6a33cab9a95934f19c7a81c refs/pull/39/head | |||
ee23c1617ad96cbed4c9f48d0c98dbf640810e0e refs/pull/4/head | |||
95ccbe2922e2a814282b2939440d37533c80ce83 refs/pull/41/head | |||
75fa10e61810568ad0c290b068cebb64ed91f090 refs/pull/42/head | |||
97c0ed50b82350bec82b1993ff1c44101507c899 refs/pull/42/merge | |||
ada86b2a53f2d9f40244679cb321fad341911448 refs/pull/44/head | |||
84b0b5ab162660cfdd2b71e49af509683ef93bde refs/pull/45/head | |||
f07f7e78ab31b60108bd416cc99ca12457f247be refs/pull/5/head | |||
49accaa785bdf9f5049de6291ec4ec3fba306272 refs/pull/50/head | |||
ca979b9e72287bd2482651e737291aea50244b3f refs/pull/51/head | |||
50f1dc811c9fced81aa03d46e0a1114e1e906dcc refs/pull/52/head | |||
e94838dbe85dbe92633b2f8a67020ef04433dcee refs/pull/53/head | |||
7d8e5146b11dcddd2d528566ea4e61380789bfe7 refs/pull/54/head | |||
120cd8aae81fec39255ef8eef001752138407756 refs/pull/55/head | |||
dd65f7faf243256aedce22135279ec8c1df120fc refs/pull/56/head | |||
cf0efed63941448072c91778f710efb753c67ec6 refs/pull/59/head | |||
6d8d533bed6935411ce700b52ee3a0b3fbd2f20f refs/pull/6/head | |||
7634d0b170df6bfda41f32e8c66bb75f6144bf69 refs/pull/60/head | |||
a52d7745602632213c08ff8778c1a86340c297ca refs/pull/60/merge | |||
24b95fa863c6b9239bc34dfa69ea3480a75974be refs/pull/61/head | |||
cf71f1419a70edf98aca48c57fd1c47b4b7b77ae refs/pull/61/merge | |||
2b90eab1d5a15f965764b07c0179ba02b14729e9 refs/pull/62/head | |||
281dafa817215d76b58a1c5f70eb80f6f92dc034 refs/pull/64/head | |||
f9e4e9f88f7632eb417b9f233588ac14e99fa971 refs/pull/65/head | |||
84ff8ea4e753aff016d8f9690392197370b21ecc refs/pull/67/head | |||
ae9d08733bbddf5a73177049c8a23e5f41f4c9b8 refs/pull/67/merge | |||
23b98fcf31b25564d0e40e1319ce99acf48b1bba refs/pull/68/head | |||
e520a1758f0501399153b7d43406e38d77ef3212 refs/pull/68/merge | |||
1afe84925de95b4d3668dc78fd689e17f88b4ac0 refs/pull/69/head | |||
2ae9f0c8e72090b3402caafaa5dc910077993cef refs/pull/7/head | |||
15a5052c33579feaa6c9a533c33055d62572ce18 refs/pull/70/head | |||
68e82ff1155d54e6b752f3394a7e56567f4262d7 refs/pull/72/head | |||
d9e0f658d820aac83f691466d7d548295ec1c41b refs/pull/77/head | |||
a160bc9bac48cbd009e6a9c98c48a1e14221f3f2 refs/pull/79/head | |||
9127234acf155fc159d0f6dea212db0aa6b8eb6a refs/pull/84/head | |||
28470aa7b7ef4683825765c3b51496775ebe87c4 refs/pull/85/head | |||
c4ffd6f26373f9d49c36aaca6ff9a5e814d58af5 refs/pull/87/head | |||
d643d61ccc0adc8884ec9e946ca8e0140ed28151 refs/pull/95/head | |||
6d023fbe26a6f0190588e55fd0068997ca837c1f refs/pull/95/merge | |||
a2ee2000bbe7a7b44f475caf09feecb2cd424c9b refs/pull/96/head | |||
e29540c73b41bdaab8b0ea0b916730ccd196acd4 refs/pull/97/head | |||
23d06faa6830625806048865e1937dcfed20c927 refs/pull/98/head |
@@ -2,7 +2,7 @@ | |||
# Contributor: alejandrogomez <alejandroogomez@gmail.com> | |||
pkgname=turses | |||
pkgver=0.2.23 | |||
pkgver=0.3.0 | |||
pkgrel=2 | |||
pkgdesc="A Twitter client for the console" | |||
arch=('any') | |||
@@ -10,7 +10,7 @@ url="http://pypi.python.org/pypi/turses/" | |||
license=('GPLv3') | |||
depends=('ncurses' 'python2' 'python2-oauth2' 'python2-tweepy' 'python2-urwid' 'python2-setuptools') | |||
source=(http://pypi.python.org/packages/source/t/$pkgname/$pkgname-$pkgver.tar.gz) | |||
md5sums=('71b9e3ab12d9186798e739b5273d1438') | |||
md5sums=('8506e3a5aedc04f391aa44b5c184e929') | |||
package() { | |||
cd "$srcdir/$pkgname-$pkgver" |
@@ -1,13 +1,13 @@ | |||
# Generated by makepkg 4.1.2 | |||
# Generated by makepkg 4.2.0 | |||
# using fakeroot version 1.20.2 | |||
# Sun Dec 14 15:06:27 UTC 2014 | |||
# Thu Jan 29 16:16:46 UTC 2015 | |||
pkgname = turses | |||
pkgver = 0.2.23-2 | |||
pkgver = 0.3.0-2 | |||
pkgdesc = A Twitter client for the console | |||
url = http://pypi.python.org/pypi/turses/ | |||
builddate = 1418569587 | |||
builddate = 1422548206 | |||
packager = Unknown Packager | |||
size = 618496 | |||
size = 610304 | |||
arch = any | |||
license = GPLv3 | |||
depend = ncurses |
@@ -1,10 +1,10 @@ | |||
#!/bin/python2 | |||
# EASY-INSTALL-ENTRY-SCRIPT: 'turses==0.2.23','console_scripts','turses' | |||
__requires__ = 'turses==0.2.23' | |||
# EASY-INSTALL-ENTRY-SCRIPT: 'turses==0.3.0','console_scripts','turses' | |||
__requires__ = 'turses==0.3.0' | |||
import sys | |||
from pkg_resources import load_entry_point | |||
if __name__ == '__main__': | |||
sys.exit( | |||
load_entry_point('turses==0.2.23', 'console_scripts', 'turses')() | |||
load_entry_point('turses==0.3.0', 'console_scripts', 'turses')() | |||
) |
@@ -1,3 +0,0 @@ | |||
oauth2 | |||
urwid | |||
tweepy >2.2,<3 |
@@ -1,6 +1,6 @@ | |||
Metadata-Version: 1.1 | |||
Name: turses | |||
Version: 0.2.23 | |||
Version: 0.3.0 | |||
Summary: A Twitter client for the console. | |||
Home-page: http://github.com/alejandrogomez/turses | |||
Author: Alejandro Gómez |
@@ -0,0 +1,2 @@ | |||
urwid | |||
tweepy==3.1.0 |
@@ -11,6 +11,6 @@ __title__ = "turses" | |||
__author__ = "Alejandro Gómez" | |||
__copyright__ = "Copyright 2012-2013 turses contributors" | |||
__license__ = "GPL3" | |||
__version__ = (0, 2, 23) | |||
__version__ = (0, 3, 0) | |||
version = "%s.%s.%s" % __version__ |
@@ -163,12 +163,16 @@ class TweepyApi(BaseTweepyApi, ApiAdapter): | |||
# from `turses.api.base.ApiAdapter` | |||
def init_api(self): | |||
oauth_handler = TweepyOAuthHandler(self._consumer_key, | |||
self._consumer_secret, | |||
secure=configuration.twitter['use_https']) | |||
oauth_handler = TweepyOAuthHandler( | |||
self._consumer_key, | |||
self._consumer_secret) | |||
oauth_handler.secure = configuration.twitter['use_https'] | |||
oauth_handler.set_access_token(self._access_token_key, | |||
self._access_token_secret) | |||
self._api = BaseTweepyApi(oauth_handler, secure=configuration.twitter['use_https']) | |||
self._api = BaseTweepyApi(oauth_handler) | |||
@to_user | |||
def verify_credentials(self): |
@@ -9,12 +9,11 @@ function to authorize `turses` to use a Twitter account obtaining the OAuth | |||
tokens. | |||
""" | |||
from ssl import SSLError | |||
from abc import ABCMeta, abstractmethod | |||
import oauth2 as oauth | |||
from urlparse import parse_qsl, urljoin | |||
from gettext import gettext as _ | |||
import tweepy | |||
from turses.models import is_DM | |||
from turses.utils import encode | |||
from turses.meta import async, wrap_exceptions | |||
@@ -35,127 +34,42 @@ def get_authorization_tokens(): | |||
Return a dictionary with `oauth_token` and `oauth_token_secret` keys | |||
if succesfull, `None` otherwise. | |||
""" | |||
# This function was borrowed from python-twitter developers and experienced | |||
# an important refactoring | |||
# | |||
# Copyright 2007 The Python-Twitter Developers | |||
# | |||
# Licensed under the Apache License, Version 2.0 (the "License"); | |||
# you may not use this file except in compliance with the License. | |||
# You may obtain a copy of the License at | |||
# | |||
# http://www.apache.org/licenses/LICENSE-2.0 | |||
# | |||
# Unless required by applicable law or agreed to in writing, software | |||
# distributed under the License is distributed on an "AS IS" BASIS, | |||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
oauth_consumer = oauth.Consumer(key=TWITTER_CONSUMER_KEY, | |||
secret=TWITTER_CONSUMER_SECRET) | |||
oauth_client = oauth.Client(oauth_consumer) | |||
oauth_client = tweepy.OAuthHandler(TWITTER_CONSUMER_KEY, | |||
TWITTER_CONSUMER_SECRET) | |||
print _('Requesting temporary token from Twitter') | |||
try: | |||
oauth_token, oauth_token_secret = get_temporary_tokens(oauth_client) | |||
except SSLError: | |||
print _("""There was an SSL certificate error, your user may not have | |||
permission to access SSL. Try executing `turses` as a | |||
privileged user.""") | |||
authorization_url_with_token = oauth_client.get_authorization_url() | |||
except tweepy.TweepError: | |||
print 'Error! Failed to get request token.' | |||
return None | |||
except Exception as e: | |||
print e | |||
return None | |||
authorization_url = urljoin(BASE_URL, '/oauth/authorize') | |||
authorization_url_with_token = urljoin(authorization_url, | |||
'?oauth_token=%s' % oauth_token) | |||
print _('Please visit the following page to retrieve the pin code needed ' | |||
'to obtain an Authorization Token:') | |||
print _('Please visit the following page to retrieve the pin code needed ' | |||
'to obtain an Authorization Token:') | |||
print authorization_url_with_token | |||
pin_code = raw_input(_('Pin code? ')) | |||
verifier = raw_input(_('Pin code? ')) | |||
print encode(_('Generating and signing request for an access token')) | |||
# Generate an OAuth token that verifies the identity of the user | |||
token = oauth.Token(oauth_token, oauth_token_secret) | |||
token.set_verifier(pin_code) | |||
# Re-create the OAuth client with the corresponding token | |||
oauth_client = oauth.Client(oauth_consumer, token) | |||
# Use the "pin code"/verifier to authorize to access to the account | |||
try: | |||
access_tokens = get_access_tokens(oauth_client, pin_code) | |||
oauth_client.get_access_token(verifier) | |||
access_tokens = {} | |||
access_tokens['oauth_token'] = oauth_client.access_token | |||
access_tokens['oauth_token_secret'] = oauth_client.access_token_secret | |||
return access_tokens | |||
except Exception as e: | |||
print e | |||
except tweepy.TweepError: | |||
print 'Error! Failed to get access token.' | |||
return None | |||
def get_temporary_tokens(oauth_client): | |||
""" | |||
Request temporary OAuth tokens using the provided `oauth_client`; these | |||
tokens require the user to confirm its identity on Twitter's website for | |||
obtaining an access token. | |||
This function will return a tuple with a public and a private OAuth tokens | |||
that can be used to retrieve an access token from Twitter if the request | |||
was successfull. | |||
If there is an error with the HTTP request, it will raise an | |||
:class:`Exception` with a meaningful error message. | |||
""" | |||
request_token_url = urljoin(BASE_URL, '/oauth/request_token') | |||
response, content = oauth_client.request(request_token_url, 'GET') | |||
status_code = int(response['status']) | |||
if status_code == HTTP_OK: | |||
response_content = dict(parse_qsl(content)) | |||
oauth_token = response_content['oauth_token'] | |||
oauth_token_secret = response_content['oauth_token_secret'] | |||
return (oauth_token, oauth_token_secret) | |||
else: | |||
error_message = _('Twitter responded with an HTTP %s code.' % str(status_code)) | |||
raise Exception(error_message) | |||
def get_access_tokens(oauth_client, pin_code): | |||
""" | |||
Request access tokens using the provided `oauth_client` and the | |||
`pin_code`that verifies the user's identity. | |||
This function will return a dictionary with `oauth_token` and | |||
`oauth_token_secret` keys if the request was successful. | |||
If there is an error with the HTTP request, it will raise an | |||
:class:`Exception` with a meaningful error message. | |||
""" | |||
access_token_url = urljoin(BASE_URL, '/oauth/access_token') | |||
response, content = oauth_client.request(access_token_url, | |||
method='POST', | |||
body='oauth_verifier=%s' % pin_code) | |||
status_code = int(response['status']) | |||
if status_code == HTTP_OK: | |||
access_token = dict(parse_qsl(content)) | |||
return access_token | |||
else: | |||
error_message = _('Twitter responded with an HTTP %s code.' % str(status_code)) | |||
raise Exception(error_message) | |||
class ApiAdapter(object): | |||
""" | |||
@@ -398,7 +312,6 @@ class AsyncApi(ApiAdapter): | |||
def reply(self, status, text): | |||
self._api.reply(status, text) | |||
@async | |||
@wrap_exceptions | |||
def retweet(self, status): |
@@ -190,10 +190,8 @@ class MockApi(ApiAdapter): | |||
def get_list_members(self, list): | |||
pass | |||
def subscribe_to_list(self, list): | |||
pass | |||
def get_list_subscribers(self, list): | |||
pass | |||
@@ -75,9 +75,9 @@ from turses.api.base import get_authorization_tokens | |||
KEY_BINDINGS = { | |||
# motion | |||
'up': | |||
('k', _('scroll up')), | |||
('k', _('scroll up')), | |||
'down': | |||
('j', _('scroll down')), | |||
('j', _('scroll down')), | |||
'left': | |||
('h', _('activate the timeline on the left')), | |||
'right': | |||
@@ -89,7 +89,7 @@ KEY_BINDINGS = { | |||
# buffers | |||
'activate_first_buffer': | |||
('a', _('activate first buffer')), | |||
('a', _('activate first buffer')), | |||
'activate_last_buffer': | |||
('e', _('activate last buffer')), | |||
'shift_buffer_beggining': | |||
@@ -133,7 +133,8 @@ KEY_BINDINGS = { | |||
'update_all': | |||
('S', _('refresh all the timelines')), | |||
'tweet_hashtag': | |||
('H', _('compose a tweet with the same hashtags as the focused status')), | |||
('H', _( | |||
'compose a tweet with the same hashtags as the focused status')), | |||
'fav': | |||
('b', _('mark focused tweet as favorite')), | |||
'delete_fav': | |||
@@ -163,11 +164,13 @@ KEY_BINDINGS = { | |||
'search_user': | |||
('@', _('open a timeline with the tweets of the specified user')), | |||
'user_timeline': | |||
('+', _('open a timeline with the tweets of the focused status\' author')), | |||
('+', _( | |||
'open a timeline with the tweets of the focused status\' author')), | |||
'thread': | |||
('T', _('open the thread of the focused status')), | |||
'hashtags': | |||
('L', _('open a search timeline with the hashtags of the focused status')), | |||
('L', _( | |||
'open a search timeline with the hashtags of the focused status')), | |||
'retweets_of_me': | |||
('I', _('open a timeline with your tweets that have been retweeted')), | |||
@@ -299,7 +302,7 @@ def validate_color(colorstring): | |||
return colorstring if colorstring in VALID_COLORS else '' | |||
PALETTE = [ | |||
#Tabs | |||
# Tabs | |||
['active_tab', 'white', 'dark blue'], | |||
['visible_tab', 'yellow', 'dark blue'], | |||
['inactive_tab', 'dark blue', ''], | |||
@@ -334,8 +337,10 @@ STYLES = { | |||
# TODO: make time string configurable | |||
'reply_indicator': '@', | |||
'retweet_indicator': 'RT', | |||
'header_template': ' {username}{retweeted}{retweeter} - {time}{reply}{retweet_count} ', | |||
'dm_template': ' {sender_screen_name} => {recipient_screen_name} - {time} ', | |||
'header_template': ( | |||
' {username}{retweeted}{retweeter} - {time}{reply}{retweet_count} '), | |||
'dm_template': ( | |||
' {sender_screen_name} => {recipient_screen_name} - {time} '), | |||
'tab_template': '{timeline_name} [{unread}]', | |||
'box_around_status': True, | |||
'status_divider': False, | |||
@@ -356,8 +361,8 @@ UPDATE_FREQUENCY = 300 | |||
USE_HTTPS = True | |||
TWITTER = { | |||
'update_frequency': UPDATE_FREQUENCY, | |||
'use_https': USE_HTTPS, | |||
'update_frequency': UPDATE_FREQUENCY, | |||
'use_https': USE_HTTPS, | |||
} | |||
# Environment | |||
@@ -395,8 +400,10 @@ SECTION_TOKEN = 'token' | |||
def print_deprecation_notice(): | |||
print "NOTE:" | |||
print "The configuration file in %s has been deprecated." % LEGACY_CONFIG_FILE | |||
print "A new configuration directory is being generated in %s." % CONFIG_PATH | |||
print "The configuration file in %s has been deprecated." % ( | |||
LEGACY_CONFIG_FILE) | |||
print "A new configuration directory is being generated in %s." % ( | |||
CONFIG_PATH) | |||
@@ -453,7 +460,8 @@ class Configuration(object): | |||
try: | |||
mkdir(CONFIG_PATH) | |||
except: | |||
print encode(_('Error creating config directory in %s' % CONFIG_DIR)) | |||
print encode(_('Error creating config directory in %s' % ( | |||
CONFIG_DIR))) | |||
self.exit_with_code(3) | |||
def parse_args(self, cli_args): | |||
@@ -469,11 +477,13 @@ class Configuration(object): | |||
if cli_args.config: | |||
self.config_file = cli_args.config | |||
elif cli_args.account: | |||
self.config_file = path.join(CONFIG_PATH, '%s.config' % cli_args.account) | |||
self.config_file = path.join(CONFIG_PATH, '%s.config' % ( | |||
cli_args.account)) | |||
# path to token file | |||
if cli_args.account: | |||
self.token_file = path.join(CONFIG_PATH, '%s.token' % cli_args.account) | |||
self.token_file = path.join(CONFIG_PATH, '%s.token' % ( | |||
cli_args.account)) | |||
# session | |||
if cli_args.session: | |||
@@ -534,16 +544,16 @@ class Configuration(object): | |||
label_name, fg, bg = label[0], label[1], label[2] | |||
# fg | |||
if conf.has_option(SECTION_PALETTE, label_name) and \ | |||
validate_color(conf.get(SECTION_PALETTE, label_name)): | |||
if (conf.has_option(SECTION_PALETTE, label_name) and | |||
validate_color(conf.get(SECTION_PALETTE, label_name))): | |||
pass | |||
else: | |||
conf.set(SECTION_PALETTE, label_name, fg) | |||
#bg | |||
# bg | |||
label_name_bg = label_name + '_bg' | |||
if conf.has_option(SECTION_PALETTE, label_name_bg) and \ | |||
validate_color(conf.get(SECTION_PALETTE, label_name_bg)): | |||
if (conf.has_option(SECTION_PALETTE, label_name_bg) and | |||
validate_color(conf.get(SECTION_PALETTE, label_name_bg))): | |||
pass | |||
else: | |||
conf.set(SECTION_PALETTE, label_name_bg, bg) | |||
@@ -570,7 +580,8 @@ class Configuration(object): | |||
self.parse_token_file(LEGACY_TOKEN_FILE) | |||
remove(LEGACY_TOKEN_FILE) | |||
if (hasattr(self, 'oauth_token') and | |||
hasattr(self, 'oauth_token_secret')): | |||
hasattr(self, 'oauth_token_secret')): | |||
self.generate_token_file(self.token_file, | |||
self.oauth_token, | |||
self.oauth_token_secret) | |||
@@ -618,17 +629,20 @@ class Configuration(object): | |||
self.oauth_token = conf.get(SECTION_TOKEN, 'oauth_token') | |||
if conf.has_option(SECTION_TOKEN, 'oauth_token'): | |||
self.oauth_token_secret = conf.get(SECTION_TOKEN, 'oauth_token_secret') | |||
self.oauth_token_secret = conf.get( | |||
SECTION_TOKEN, 'oauth_token_secret') | |||
def _set_color(self, color_label, custom_fg=None, custom_bg=None): | |||
for color in self.palette: | |||
label, fg, bg = color[0], color[1], color[2] | |||
if label == color_label: | |||
color[1] = custom_fg if validate_color(custom_fg) is not None else fg | |||
color[2] = custom_bg if validate_color(custom_bg) is not None else bg | |||
color[1] = (custom_fg | |||
if validate_color(custom_fg) is not None else fg) | |||
color[2] = (custom_bg | |||
if validate_color(custom_bg) is not None else bg) | |||
def _set_key_binding(self, binding, new_key): | |||
if not binding in self.key_bindings: | |||
if binding not in self.key_bindings: | |||
return | |||
key, description = self.key_bindings[binding] | |||
@@ -666,7 +680,8 @@ class Configuration(object): | |||
print encode(_('Generated configuration file in %s')) % config_file | |||
def _config_generation_error(self, config_file): | |||
print encode(_('Unable to generate configuration file in %s')) % config_file | |||
print encode(_('Unable to generate configuration file in %s')) % ( | |||
config_file) | |||
self.exit_with_code(2) | |||
def generate_token_file(self, | |||
@@ -698,9 +713,11 @@ class Configuration(object): | |||
def _parse_twitter(self, conf): | |||
if conf.has_option(SECTION_TWITTER, 'update_frequency'): | |||
self.twitter['update_frequency'] = conf.getint(SECTION_TWITTER, 'update_frequency') | |||
self.twitter['update_frequency'] = conf.getint(SECTION_TWITTER, | |||
'update_frequency') | |||
if conf.has_option(SECTION_TWITTER, 'use_https'): | |||
self.twitter['use_https'] = conf.getboolean(SECTION_TWITTER, 'use_https') | |||
self.twitter['use_https'] = conf.getboolean(SECTION_TWITTER, | |||
'use_https') | |||
def _parse_key_bindings(self, conf): | |||
for binding in self.key_bindings: | |||
@@ -734,8 +751,8 @@ class Configuration(object): | |||
elif style == 'statuses_in_user_info': | |||
self.styles[style] = conf.getint(SECTION_STYLES, style) | |||
else: | |||
self.styles[style] = unicode(conf.get(SECTION_STYLES, style), | |||
'utf-8') | |||
self.styles[style] = unicode( | |||
conf.get(SECTION_STYLES, style), 'utf-8') | |||
def _parse_debug(self, conf): | |||
if conf.has_option(SECTION_DEBUG, 'logging_level'): | |||
@@ -748,7 +765,8 @@ class Configuration(object): | |||
if conf.has_option(SECTION_TOKEN, 'oauth_token'): | |||
self.oauth_token = conf.get(SECTION_TOKEN, 'oauth_token') | |||
if conf.has_option(SECTION_TOKEN, 'oauth_token_secret'): | |||
self.oauth_token_secret = conf.get(SECTION_TOKEN, 'oauth_token_secret') | |||
self.oauth_token_secret = conf.get(SECTION_TOKEN, | |||
'oauth_token_secret') | |||
def authorize_new_account(self): | |||
access_tokens = get_authorization_tokens() |
@@ -212,10 +212,7 @@ class InputHandler(object): | |||
return len(key) >= 2 and 'mouse' in key[0] | |||
# Decorators | |||
def has_active_status(func): | |||
""" | |||
`func` only is executed if there is a active status. | |||
@@ -338,11 +335,12 @@ class Controller(Observer): | |||
if not hasattr(self, 'loop'): | |||
# Creating the main loop for the first time | |||
self.input_handler = InputHandler(self) | |||
self.loop = urwid.MainLoop(self.ui, | |||
configuration.palette, | |||
handle_mouse=True, | |||
unhandled_input=self.input_handler.handle, | |||
input_filter=self.input_handler.filter_input) | |||
self.loop = urwid.MainLoop( | |||
self.ui, | |||
configuration.palette, | |||
handle_mouse=True, | |||
unhandled_input=self.input_handler.handle, | |||
input_filter=self.input_handler.filter_input) | |||
# Authenticate API just before starting main loop | |||
self.authenticate_api() | |||
@@ -1072,7 +1070,8 @@ class Controller(Observer): | |||
status = self.timelines.active_status | |||
if is_DM(status): | |||
self.error_message(_('You can\'t retweet or favorite direct messages')) | |||
self.error_message( | |||
_('You can\'t retweet or favorite direct messages')) | |||
return | |||
self._retweet(status) | |||
@@ -1137,7 +1136,8 @@ class Controller(Observer): | |||
return | |||
author = status.authors_username | |||
if author != self.user.screen_name and status.user != self.user.screen_name: | |||
if (author != self.user.screen_name | |||
and status.user != self.user.screen_name): | |||
self.error_message(_('You can only delete your own tweets')) | |||
return | |||
@@ -214,8 +214,8 @@ class Updatable: | |||
def notify(func): | |||
""" | |||
Wrap an instance method `func`, calling the instance's `notify` method after | |||
executing `func`. | |||
Wrap an instance method `func`, calling the instance's `notify` method | |||
after executing `func`. | |||
""" | |||
@wraps(func) | |||
def wrapper(self, *args, **kwargs): |
@@ -95,7 +95,7 @@ class TimelineList(UnsortedActiveList, Observable): | |||
right_indexes = self.visible[old_index_in_visible + 1:] | |||
# decrement those that are in the right of the deleted one | |||
self.visible = left_indexes + [index - 1 for index in right_indexes | |||
if index] | |||
if index] | |||
elif len(self.visible) == 1: | |||
visible_index = self.visible[0] | |||
if not self.is_valid_index(visible_index): | |||
@@ -221,8 +221,8 @@ class TimelineList(UnsortedActiveList, Observable): | |||
`Timeline` objects contained in those positions. | |||
""" | |||
if self.is_valid_index(one) and self.is_valid_index(other): | |||
self.timelines[one], self.timelines[other] = \ | |||
self.timelines[other], self.timelines[one] | |||
self.timelines[one], self.timelines[other] = ( | |||
self.timelines[other], self.timelines[one]) | |||
def _mark_read(self): | |||
if self.has_timelines(): |
@@ -92,7 +92,8 @@ def clean_timeline_list_string(timeline_list_string): | |||
`timeline_list_string`. | |||
""" | |||
timeline_names = [name.strip() for name in timeline_list_string.split(',')] | |||
return [name.lower() for name in timeline_names if not invalid_name_re.match(name)] | |||
return [name.lower() | |||
for name in timeline_names if not invalid_name_re.match(name)] | |||
class Session: |
@@ -32,10 +32,10 @@ from turses.utils import encode, is_hashtag, is_username, is_url | |||
def surround_with_spaces(s): | |||
return ' '.join(['', s , '']) | |||
return ' '.join(['', s, '']) | |||
# - Text parsing -------------------------------------------------------------- | |||
# - Text parsing -------------------------------------------------------------- | |||
def apply_attribute(string, | |||
hashtag='hashtag', | |||
attag='attag', | |||
@@ -214,8 +214,8 @@ def map_attributes(status, hashtag, attag, url): | |||
entity_text = status_text[starts:ends] | |||
if attribute == url and len(mapping) == 3: | |||
## if the text is a url and a third element is included in the | |||
## tuple; the third element is the original URL | |||
# if the text is a url and a third element is included in the | |||
# tuple; the third element is the original URL | |||
entity_text = mapping[2] | |||
# append normal text before the text with an attribute | |||
@@ -510,7 +510,6 @@ class Banner(WidgetWrap): | |||
"", | |||
_("Configuration and token files reside under"), | |||
_("your $HOME directory ({0})").format(home_dir), | |||
#"", | |||
"", | |||
" ~ ", | |||
" |+.turses/ ", | |||
@@ -947,7 +946,8 @@ class TimelinesBuffer(ScrollableWidgetWrap): | |||
ScrollableWidgetWrap.__init__(self, widget) | |||
def _build_widget(self, timelines, **kwargs): | |||
timeline_widgets = [TimelineWidget(timeline, **kwargs) for timeline in timelines] | |||
timeline_widgets = [TimelineWidget(timeline, **kwargs) | |||
for timeline in timelines] | |||
return Columns(timeline_widgets) | |||
def render_timelines(self, timelines, **kwargs): | |||
@@ -1037,7 +1037,8 @@ class StatusWidget(WidgetWrap): | |||
divider = configuration.styles.get('status_divider', False) | |||
header = AttrMap(Text(header_text), 'header') | |||
sanitized_text = [sanitize(t) for t in text] if isinstance(text, list) else sanitize(text) | |||
sanitized_text = ([sanitize(t) for t in text] | |||
if isinstance(text, list) else sanitize(text)) | |||
body = Padding(AttrMap(Text(sanitized_text), 'body'), left=1, right=1) | |||
border_attr = 'line' | |||
@@ -1087,11 +1088,13 @@ class StatusWidget(WidgetWrap): | |||
# reply | |||
if status.is_reply: | |||
reply = surround_with_spaces(configuration.styles['reply_indicator']) | |||
reply = surround_with_spaces( | |||
configuration.styles['reply_indicator']) | |||
# retweet | |||
if status.is_retweet: | |||
retweeted = surround_with_spaces(configuration.styles['retweet_indicator']) | |||
retweeted = surround_with_spaces( | |||
configuration.styles['retweet_indicator']) | |||
# `username` is the author of the original tweet | |||
username = status.author | |||
# `retweeter` is the user who made the RT | |||
@@ -1221,13 +1224,15 @@ class UserInfo(WidgetWrap): | |||
# Last n statuses | |||
# TODO: make it configurable | |||
statuses_to_show = configuration.styles['statuses_in_user_info'] | |||
status_widgets = [StatusWidget(status) for status in last_statuses[:statuses_to_show]] | |||
status_widgets = [StatusWidget(status) | |||
for status in last_statuses[:statuses_to_show]] | |||
widgets.extend(status_widgets) | |||
pile = Pile(widgets) | |||
super(UserInfo, self).__init__(LineBox(title='@{0}'.format(user.screen_name), | |||
original_widget=pile)) | |||
super(UserInfo, self).__init__( | |||
LineBox(title='@{0}'.format(user.screen_name), | |||
original_widget=pile)) | |||
def sanitize(text): | |||
@@ -1236,6 +1241,7 @@ def sanitize(text): | |||
else: | |||
return text | |||
def html_unescape(string): | |||
"""Unescape HTML entities from ``string``.""" | |||
def entity_replacer(m): | |||
@@ -1246,4 +1252,3 @@ def html_unescape(string): | |||
return m.group(0) | |||
return re.sub(r'&([^;]+);', entity_replacer, string) | |||
@@ -6,9 +6,7 @@ This module contains functions used across different modules. | |||
from re import findall | |||
from re import compile as compile_regex | |||
from subprocess import call | |||
from sys import stdout | |||
from os import devnull | |||
from functools import partial | |||
@@ -50,6 +48,7 @@ def encode(string): | |||
except (AttributeError, TypeError): | |||
return string | |||
# For Python < 2.7 | |||
# Code borrowed from python 2.7.3 stdlib | |||
def total_ordering(cls): | |||
@@ -70,8 +69,9 @@ def total_ordering(cls): | |||
} | |||
roots = set(dir(cls)) & set(convert) | |||
if not roots: | |||
raise ValueError('must define at least one ordering operation: < > <= >=') | |||
root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__ | |||
raise ValueError( | |||
'must define at least one ordering operation: < > <= >=') | |||
root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__ | |||
for opname, opfunc in convert[root]: | |||
if opname not in roots: | |||
opfunc.__name__ = opname |