Skip to content

Commit 5a0f942

Browse files
committed
4.7 small fix
1 parent aff8fc8 commit 5a0f942

9 files changed

Lines changed: 30 additions & 14 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ upload_to_PyPi.py
66
.project
77
.pydevproject
88
.settings/
9-
.idea/
9+
.idea/
10+
/testing

MANIFEST

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
setup.py
33
jconfig\__init__.py
44
jconfig\jconfig.py
5-
test\test.py
65
vk_api\__init__.py
76
vk_api\vk_api.py
7+
vk_api\vk_tools.py
88
vk_api\vk_upload.py

example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@contact: http://vk.com/python273
66
@license Apache License, Version 2.0, see LICENSE file
77
8-
Copyright (C) 2013
8+
Copyright (C) 2014
99
'''
1010

1111
import vk_api

jconfig/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
@contact: http://vk.com/python273
66
@license Apache License, Version 2.0, see LICENSE file
77
8-
Copyright (C) 2013
8+
Copyright (C) 2014
99
'''
1010

1111
__author__ = "Kirill Python"
1212
__version__ = "1.1"
13-
__email__ = "mikeking568@gmail.com"
13+
__email__ = "siberianpython@gmail.com"
1414
__contact__ = "https://vk.com/python273"
1515

1616

jconfig/jconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@contact: http://vk.com/python273
66
@license Apache License, Version 2.0, see LICENSE file
77
8-
Copyright (C) 2013
8+
Copyright (C) 2014
99
'''
1010

1111
import os

vk_api/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
@contact: http://vk.com/python273
66
@license Apache License, Version 2.0, see LICENSE file
77
8-
Copyright (C) 2013
8+
Copyright (C) 2014
99
'''
1010

1111
__author__ = "Kirill Python"
12-
__version__ = "4.6.6"
13-
__email__ = "mikeking568@gmail.com"
12+
__version__ = "4.7"
13+
__email__ = "siberianpython@gmail.com"
1414
__contact__ = "https://vk.com/python273"
1515

1616
import sys

vk_api/vk_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@contact: http://vk.com/python273
66
@license Apache License, Version 2.0, see LICENSE file
77
8-
Copyright (C) 2013
8+
Copyright (C) 2014
99
'''
1010

1111
import jconfig

vk_api/vk_tools.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# encoding: utf-8
2+
3+
'''
4+
@author: Kirill Python
5+
@contact: http://vk.com/python273
6+
@license Apache License, Version 2.0, see LICENSE file
7+
8+
Copyright (C) 2014
9+
'''
10+
211
import json
312
import sys
413

@@ -80,4 +89,8 @@ def get_all_slow(self, method, values=None, max_count=200, key='items'):
8089
return {'count': len(items), key: items}
8190

8291
# Полный код в файле vk_procedures
83-
code_get_all_items = 'var z=%s,x=%s,y=%s,k="%s",p={"count":z}+y,r=API.%s(p),c=r["count"],j=r[k],o=0,i=1;while(i<25&&o<c){o=i*z+x;p={"count":z,"offset":o}+y;r=API.%s(p);j=j+r[k];i=i+1;};return{"count":c,"items":j,"offset":o,"end":o+z>=c};'
92+
code_get_all_items = '''
93+
var z=%s,x=%s,y=%s,k="%s",p={"count":z}+y,r=API.%s(p),c=r["count"],j=r[k],o=0,
94+
i=1;while(i<25&&o<c){o=i*z+x;p={"count":z,"offset":o}+y;r=API.%s(p);j=j+r[k];i
95+
=i+1;};return{"count":c,"items":j,"offset":o,"end":o+z>=c};
96+
'''.replace('\n', '')

vk_api/vk_upload.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@contact: http://vk.com/python273
66
@license Apache License, Version 2.0, see LICENSE file
77
8-
Copyright (C) 2013
8+
Copyright (C) 2014
99
'''
1010

1111

@@ -20,7 +20,7 @@ def photo(self, photos, album_id=None, group_id=None):
2020
photos = ['photo1.jpg', 'img.png']
2121
= 'screen.png'
2222
Максимум 5 фотографий
23-
23+
2424
album_id
2525
'''
2626

@@ -73,7 +73,8 @@ def photoMessages(self, photos, group_id=None):
7373
values.update({'group_id': group_id})
7474

7575
# Получаем ссылку для загрузки
76-
url = self.vk.method('photos.getMessagesUploadServer', values)['upload_url']
76+
url = self.vk.method('photos.getMessagesUploadServer', values)
77+
url = url['upload_url']
7778

7879
# Загружаем
7980
photos_files = openPhotos(photos)
@@ -96,6 +97,7 @@ def openPhotos(photos_paths):
9697

9798
return photos
9899

100+
99101
def closePhotos(photos):
100102
for i in photos:
101103
photos[i].close()

0 commit comments

Comments
 (0)