Updated version to 2016.3
This commit is contained in:
parent
1c9006ec31
commit
e825f88f24
10
.SRCINFO
10
.SRCINFO
@ -1,8 +1,8 @@
|
||||
# Generated by mksrcinfo v8
|
||||
# Thu Sep 8 03:36:07 UTC 2016
|
||||
# Wed Nov 23 16:48:46 UTC 2016
|
||||
pkgbase = pycharm-professional
|
||||
pkgdesc = Powerful Python and Django IDE. Professional edition.
|
||||
pkgver = 2016.2.3
|
||||
pkgver = 2016.3.0
|
||||
pkgrel = 1
|
||||
url = http://www.jetbrains.com/pycharm/
|
||||
install = pycharm-professional.install
|
||||
@ -35,18 +35,18 @@ pkgbase = pycharm-professional
|
||||
conflicts = pycharm
|
||||
conflicts = pycharm-community
|
||||
options = !strip
|
||||
source = https://download.jetbrains.com/python/pycharm-professional-2016.2.3-no-jdk.tar.gz
|
||||
source = https://download.jetbrains.com/python/pycharm-professional-2016.3-no-jdk.tar.gz
|
||||
source = pycharm-professional.desktop
|
||||
source = pycharm-professional.install
|
||||
source = pycharm
|
||||
source = charm.desktop
|
||||
source = charm
|
||||
sha256sums = 1b830c0eb2ee360ff45967c820b456987c830e283aacc8139bded2ba1bfac0d8
|
||||
sha256sums = 192df48cdb9e2eac383f39a4a9cafb667be9ef7e183b85dc276623993fcbf722
|
||||
sha256sums = 016db1860a8b36d408c827f90aeb04b9d55cf21ea36788a9d8510cc54fae1c49
|
||||
sha256sums = c1a74303d9e870918bd8068f761c8251b996694b1b96b3537fbca317679c4958
|
||||
sha256sums = 43e79e5a786fc76385634dc0a9f1c3489b25031745b840b0822b059fc91d1060
|
||||
sha256sums = a90a2b645e733627fefe568ae82fc96716772c13b4431760a822c0c64b0596e9
|
||||
sha256sums = dbe4055a0e4980dba5c5104b6a9ec30a3e429e4e3ef5ef92efef2627403e7ac5
|
||||
sha256sums = 09605bd8e6e44d20ee4f0f840df50f6991719856df1becd42dac4470d2b80eba
|
||||
|
||||
pkgname = pycharm-professional
|
||||
|
||||
|
17
PKGBUILD
17
PKGBUILD
@ -1,7 +1,8 @@
|
||||
# Maintainer: XavierCLL <xavier.corredor.llano (a) gmail.com>
|
||||
|
||||
pkgname=pycharm-professional
|
||||
pkgver=2016.2.3
|
||||
pkgver=2016.3.0
|
||||
_pkgver=2016.3
|
||||
pkgrel=1
|
||||
pkgdesc="Powerful Python and Django IDE. Professional edition."
|
||||
arch=('any')
|
||||
@ -13,7 +14,7 @@ license=('custom')
|
||||
install=${pkgname}.install
|
||||
depends=('java-runtime-common' 'java-runtime>=8' 'ttf-font' 'libxtst' 'libxslt')
|
||||
makedepends=('python2-setuptools' 'python-setuptools')
|
||||
source=(https://download.jetbrains.com/python/$pkgname-$pkgver-no-jdk.tar.gz
|
||||
source=(https://download.jetbrains.com/python/$pkgname-$_pkgver-no-jdk.tar.gz
|
||||
'pycharm-professional.desktop'
|
||||
'pycharm-professional.install'
|
||||
'pycharm'
|
||||
@ -35,29 +36,29 @@ optdepends=('ipython2: For enhanced interactive Python shell v2 inside Pycharm'
|
||||
'python-pytest: For support testing inside Pycharm with Python 3'
|
||||
'python2-tox: Python environments for testing tool with Python 2'
|
||||
'python-tox: Python environments for testing tool with Python 3')
|
||||
sha256sums=('1b830c0eb2ee360ff45967c820b456987c830e283aacc8139bded2ba1bfac0d8'
|
||||
sha256sums=('192df48cdb9e2eac383f39a4a9cafb667be9ef7e183b85dc276623993fcbf722'
|
||||
'016db1860a8b36d408c827f90aeb04b9d55cf21ea36788a9d8510cc54fae1c49'
|
||||
'c1a74303d9e870918bd8068f761c8251b996694b1b96b3537fbca317679c4958'
|
||||
'43e79e5a786fc76385634dc0a9f1c3489b25031745b840b0822b059fc91d1060'
|
||||
'a90a2b645e733627fefe568ae82fc96716772c13b4431760a822c0c64b0596e9'
|
||||
'dbe4055a0e4980dba5c5104b6a9ec30a3e429e4e3ef5ef92efef2627403e7ac5')
|
||||
'09605bd8e6e44d20ee4f0f840df50f6991719856df1becd42dac4470d2b80eba')
|
||||
|
||||
package() {
|
||||
# compile PyDev debugger used by PyCharm to speedup debugging
|
||||
python2 $srcdir/pycharm-$pkgver/helpers/pydev/setup_cython.py build_ext --inplace
|
||||
python3 $srcdir/pycharm-$pkgver/helpers/pydev/setup_cython.py build_ext --inplace
|
||||
python2 $srcdir/pycharm-$_pkgver/helpers/pydev/setup_cython.py build_ext --inplace
|
||||
python3 $srcdir/pycharm-$_pkgver/helpers/pydev/setup_cython.py build_ext --inplace
|
||||
|
||||
# base
|
||||
cd $srcdir
|
||||
install -dm 755 $pkgdir/opt/$pkgname
|
||||
cp -dr --no-preserve=ownership $srcdir/pycharm-$pkgver/* $pkgdir/opt/$pkgname
|
||||
cp -dr --no-preserve=ownership $srcdir/pycharm-$_pkgver/* $pkgdir/opt/$pkgname
|
||||
install -dm 755 $pkgdir/usr/share/{applications,pixmaps}
|
||||
install -dm 755 $pkgdir/usr/bin/
|
||||
install -Dm 644 $pkgdir/opt/$pkgname/bin/pycharm.png $pkgdir/usr/share/pixmaps/pycharm.png
|
||||
|
||||
# licenses
|
||||
install -dm 755 $pkgdir/usr/share/licenses/$pkgname/
|
||||
cp -dr --no-preserve=ownership $srcdir/pycharm-$pkgver/license/* $pkgdir/usr/share/licenses/$pkgname
|
||||
cp -dr --no-preserve=ownership $srcdir/pycharm-$_pkgver/license/* $pkgdir/usr/share/licenses/$pkgname
|
||||
|
||||
# exec
|
||||
install -Dm 755 pycharm $pkgdir/usr/bin/
|
||||
|
135
charm
135
charm
@ -10,97 +10,98 @@ import time
|
||||
# see com.intellij.idea.SocketLock for the server side of this interface
|
||||
|
||||
RUN_PATH = u'/opt/pycharm-professional/bin/pycharm.sh'
|
||||
CONFIG_PATH = u'~/.PyCharm2016.2/config'
|
||||
SYSTEM_PATH = u'~/.PyCharm2016.2/system'
|
||||
CONFIG_PATH = u'~/.PyCharm2016.3/config'
|
||||
SYSTEM_PATH = u'~/.PyCharm2016.3/system'
|
||||
|
||||
args = []
|
||||
skip_next = False
|
||||
for i, arg in enumerate(sys.argv[1:]):
|
||||
if arg == '-h' or arg == '-?' or arg == '--help':
|
||||
print(('Usage:\n' +
|
||||
' {0} -h |-? | --help\n' +
|
||||
' {0} [-l|--line line] file[:line]\n' +
|
||||
' {0} diff <left> <right>\n' +
|
||||
' {0} merge <local> <remote> [base] <merged>').format(sys.argv[0]))
|
||||
exit(0)
|
||||
elif arg == 'diff' and i == 0:
|
||||
args.append(arg)
|
||||
elif arg == 'merge' and i == 0:
|
||||
args.append(arg)
|
||||
elif arg == '-l' or arg == '--line':
|
||||
args.append(arg)
|
||||
skip_next = True
|
||||
elif skip_next:
|
||||
args.append(arg)
|
||||
skip_next = False
|
||||
else:
|
||||
if ':' in arg:
|
||||
file_path, line_number = arg.rsplit(':', 1)
|
||||
if line_number.isdigit():
|
||||
args.append('-l')
|
||||
args.append(line_number)
|
||||
args.append(os.path.abspath(file_path))
|
||||
def print_usage(cmd):
|
||||
print(('Usage:\n' +
|
||||
' {0} -h | -? | --help\n' +
|
||||
' {0} [-l|--line line] file[:line]\n' +
|
||||
' {0} diff <left> <right>\n' +
|
||||
' {0} merge <local> <remote> [base] <merged>').format(cmd))
|
||||
|
||||
|
||||
def process_args(argv):
|
||||
args = []
|
||||
|
||||
skip_next = False
|
||||
for i, arg in enumerate(argv[1:]):
|
||||
if arg == '-h' or arg == '-?' or arg == '--help':
|
||||
print_usage(argv[0])
|
||||
exit(0)
|
||||
elif arg == 'diff' and i == 0:
|
||||
args.append(arg)
|
||||
elif arg == 'merge' and i == 0:
|
||||
args.append(arg)
|
||||
elif arg == '-l' or arg == '--line':
|
||||
args.append(arg)
|
||||
skip_next = True
|
||||
elif skip_next:
|
||||
args.append(arg)
|
||||
skip_next = False
|
||||
else:
|
||||
if ':' in arg:
|
||||
file_path, line_number = arg.rsplit(':', 1)
|
||||
if line_number.isdigit():
|
||||
args.append('-l')
|
||||
args.append(line_number)
|
||||
args.append(os.path.abspath(file_path))
|
||||
else:
|
||||
args.append(os.path.abspath(arg))
|
||||
else:
|
||||
args.append(os.path.abspath(arg))
|
||||
else:
|
||||
args.append(os.path.abspath(arg))
|
||||
|
||||
return args
|
||||
|
||||
|
||||
def launch_with_port(port, token):
|
||||
found = False
|
||||
def try_activate_instance(args):
|
||||
port_path = os.path.join(CONFIG_PATH, 'port')
|
||||
token_path = os.path.join(SYSTEM_PATH, 'token')
|
||||
if not (os.path.exists(port_path) and os.path.exists(token_path)):
|
||||
return False
|
||||
|
||||
with open(port_path) as pf, open(token_path) as tf:
|
||||
port = int(pf.read())
|
||||
token = tf.read()
|
||||
|
||||
s = socket.socket()
|
||||
s.settimeout(0.3)
|
||||
try:
|
||||
s.connect(('127.0.0.1', port))
|
||||
except:
|
||||
except (socket.error, IOError):
|
||||
return False
|
||||
|
||||
found = False
|
||||
while True:
|
||||
try:
|
||||
path_len = struct.unpack(">h", s.recv(2))[0]
|
||||
path_len = struct.unpack('>h', s.recv(2))[0]
|
||||
path = s.recv(path_len)
|
||||
if os.path.abspath(path) == os.path.abspath(CONFIG_PATH):
|
||||
found = True
|
||||
break
|
||||
except:
|
||||
break
|
||||
except (socket.error, IOError):
|
||||
return False
|
||||
|
||||
if found:
|
||||
if args:
|
||||
cmd = "activate " + token + '\0' + os.getcwd() + "\0" + "\0".join(args)
|
||||
encoded = struct.pack(">h", len(cmd)) + cmd
|
||||
s.send(encoded)
|
||||
time.sleep(0.5) # don't close socket immediately
|
||||
cmd = 'activate ' + token + '\0' + os.getcwd() + '\0' + '\0'.join(args)
|
||||
encoded = struct.pack('>h', len(cmd)) + cmd
|
||||
s.send(encoded)
|
||||
time.sleep(0.5) # don't close the socket immediately
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
port_path = os.path.join(CONFIG_PATH, 'port')
|
||||
token_path = os.path.join(SYSTEM_PATH, 'token')
|
||||
if os.path.exists(port_path) and os.path.exists(token_path):
|
||||
try:
|
||||
f = open(port_path)
|
||||
port = int(f.read())
|
||||
f.close()
|
||||
|
||||
f = open(token_path)
|
||||
token = f.read()
|
||||
f.close()
|
||||
|
||||
launch_with_port(port, token)
|
||||
except:
|
||||
type, value, traceback = sys.exc_info()
|
||||
print('Cannot activate a running instance: ' + str(value))
|
||||
else:
|
||||
print('No IDE instance has been found. New one will be started.')
|
||||
if sys.platform == "darwin":
|
||||
# OS X: RUN_PATH is *.app path
|
||||
if len(args):
|
||||
args.insert(0, "--args")
|
||||
os.execvp("open", ["-a", RUN_PATH] + args)
|
||||
def start_new_instance(args):
|
||||
if sys.platform == 'darwin':
|
||||
if len(args) > 0:
|
||||
args.insert(0, '--args')
|
||||
os.execvp('open', ['-a', RUN_PATH] + args)
|
||||
else:
|
||||
# Unix common
|
||||
bin_dir, bin_file = os.path.split(RUN_PATH)
|
||||
bin_file = os.path.split(RUN_PATH)[1]
|
||||
os.execv(RUN_PATH, [bin_file] + args)
|
||||
|
||||
|
||||
ide_args = process_args(sys.argv)
|
||||
if not try_activate_instance(ide_args):
|
||||
start_new_instance(ide_args)
|
||||
|
Loading…
x
Reference in New Issue
Block a user