Modularize PyBitmessage into multiple files #242

Merged
Atheros1 merged 10 commits from master into master 2013-06-22 00:16:01 +02:00
Showing only changes of commit c2cfff2a2e - Show all commits

View File

@ -4058,27 +4058,18 @@ if __name__ == "__main__":
print 'Error message:', err print 'Error message:', err
os._exit(0) os._exit(0)
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text): # A non-QT version of _translate is defined below.
return QtGui.QApplication.translate(context, text)
except Exception as err:
print 'Error:', err
import bitmessageqt import bitmessageqt
bitmessageqt.run() bitmessageqt.run()
else: else:
def _translate(context, text): # A QT version of _translate is defined above.
if '%' in text:
return translateClass(context, text.replace('%','',1))
else:
return text
shared.printLock.acquire() shared.printLock.acquire()
print 'Running as a daemon. You can use Ctrl+C to exit.' print 'Running as a daemon. You can use Ctrl+C to exit.'
shared.printLock.release() shared.printLock.release()
while True: while True:
time.sleep(20) time.sleep(20)
def _translate(context, text):
return translateText(context, text)
def translateText(context, text): def translateText(context, text):
if not shared.safeConfigGetBoolean('bitmessagesettings', 'daemon'): if not shared.safeConfigGetBoolean('bitmessagesettings', 'daemon'):
try: try: