4 Commits

Author SHA1 Message Date
ac07cb529f reconnection bug fixed 2017-04-22 22:35:32 +03:00
4f77e2c105 @cached 2017-04-17 22:04:22 +03:00
47ce9252b7 Merge pull request #41 from nurupo/fix-md-formatting
Fix markdown formatting
2017-04-12 17:16:06 +03:00
9153836ead Fix markdown formatting 2017-04-12 10:10:48 -04:00
8 changed files with 29 additions and 11 deletions

View File

@ -1,4 +1,4 @@
#Issues # Issues
Help us find all bugs in Toxygen! Please provide following info: Help us find all bugs in Toxygen! Please provide following info:
@ -9,12 +9,12 @@ Help us find all bugs in Toxygen! Please provide following info:
Want to see new feature in Toxygen? [Ask for it!](https://github.com/toxygen-project/toxygen/issues) Want to see new feature in Toxygen? [Ask for it!](https://github.com/toxygen-project/toxygen/issues)
#Pull requests # Pull requests
Developer? Feel free to open pull request. Our dev team is small so we glad to get help. Developer? Feel free to open pull request. Our dev team is small so we glad to get help.
Don't know what to do? Improve UI, fix [issues](https://github.com/toxygen-project/toxygen/issues) or implement features from our TODO list. Don't know what to do? Improve UI, fix [issues](https://github.com/toxygen-project/toxygen/issues) or implement features from our TODO list.
You can find our TODO's in code, issues list and [here](/README.md). Also you can implement [plugins](/docs/plugins.md) for Toxygen. You can find our TODO's in code, issues list and [here](/README.md). Also you can implement [plugins](/docs/plugins.md) for Toxygen.
#Translations # Translations
Help us translate Toxygen! Translation can be created using pyside-lupdate (``pyside-lupdate toxygen.pro``) and QT Linguist. Help us translate Toxygen! Translation can be created using pyside-lupdate (``pyside-lupdate toxygen.pro``) and QT Linguist.

View File

@ -1,4 +1,4 @@
#Smileys # Smileys
Toxygen support smileys. Smiley is small picture which replaces some symbol or combination of symbols. If you want to create your own smiley pack, create directory in src/smileys/. This directory must contain images with smileys and config.json. Example of config.json: Toxygen support smileys. Smiley is small picture which replaces some symbol or combination of symbols. If you want to create your own smiley pack, create directory in src/smileys/. This directory must contain images with smileys and config.json. Example of config.json:
@ -6,7 +6,7 @@ Toxygen support smileys. Smiley is small picture which replaces some symbol or c
Animated smileys (.gif) are supported too. Animated smileys (.gif) are supported too.
#Stickers # Stickers
Sticker is inline image. If you want to create your own smiley pack, create directory in src/stickers/ and place your stickers there. Sticker is inline image. If you want to create your own smiley pack, create directory in src/stickers/ and place your stickers there.

View File

@ -141,4 +141,3 @@ class AV:
if state & TOXAV_FRIEND_CALL_STATE['ACCEPTING_A']: if state & TOXAV_FRIEND_CALL_STATE['ACCEPTING_A']:
self._calls[friend_number] |= 1 self._calls[friend_number] |= 1

View File

@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
from sqlite3 import connect from sqlite3 import connect
import settings import settings
from os import chdir from os import chdir

View File

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
import sys import sys
from loginscreen import LoginScreen from loginscreen import LoginScreen
import profile import profile

View File

@ -88,6 +88,7 @@ class Profile(basecontact.BaseContact, Singleton):
if status is not None: if status is not None:
self._tox.self_set_status(status) self._tox.self_set_status(status)
elif not self._waiting_for_reconnection: elif not self._waiting_for_reconnection:
self._waiting_for_reconnection = True
QtCore.QTimer.singleShot(50000, self.reconnect) QtCore.QTimer.singleShot(50000, self.reconnect)
def set_name(self, value): def set_name(self, value):

View File

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
import os import os
import time import time
import shutil import shutil
@ -7,11 +9,25 @@ import re
program_version = '0.2.8' program_version = '0.2.8'
def cached(func):
saved_result = None
def wrapped_func():
nonlocal saved_result
if saved_result is None:
saved_result = func()
return saved_result
return wrapped_func
def log(data): def log(data):
with open(curr_directory() + '/logs.log', 'a') as fl: with open(curr_directory() + '/logs.log', 'a') as fl:
fl.write(str(data) + '\n') fl.write(str(data) + '\n')
@cached
def curr_directory(): def curr_directory():
return os.path.dirname(os.path.realpath(__file__)) return os.path.dirname(os.path.realpath(__file__))
@ -46,9 +62,8 @@ def convert_time(t):
return '%02d:%02d' % (h, m) return '%02d:%02d' % (h, m)
@cached
def time_offset(): def time_offset():
if hasattr(time_offset, 'offset'):
return time_offset.offset
hours = int(time.strftime('%H')) hours = int(time.strftime('%H'))
minutes = int(time.strftime('%M')) minutes = int(time.strftime('%M'))
sec = int(time.time()) - time.timezone sec = int(time.time()) - time.timezone
@ -56,7 +71,6 @@ def time_offset():
h, m = divmod(m, 60) h, m = divmod(m, 60)
d, h = divmod(h, 24) d, h = divmod(h, 24)
result = hours * 60 + minutes - h * 60 - m result = hours * 60 + minutes - h * 60 - m
time_offset.offset = result
return result return result

View File

@ -137,4 +137,3 @@ class MultilineEdit(CenteredWidget):
def button_click(self): def button_click(self):
self.save(self.edit.toPlainText()) self.save(self.edit.toPlainText())
self.close() self.close()