Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0b0812bb by Philipp Hörist at 2017-04-21T18:44:27+02:00
Start HistoryManager with config path argument
HistoryManager was not finding the Logs.db when Gajim was
used with the -c config path argument
- - - - -
2 changed files:
- src/app_actions.py
- src/common/helpers.py
Changes:
=====================================
src/app_actions.py
=====================================
--- a/src/app_actions.py
+++ b/src/app_actions.py
@@ -60,16 +60,15 @@ class AppActions():
gajim.interface.instances['accounts'] = config.AccountsWindow()
def on_history_manager(self, action, param):
- if os.name == 'nt':
- if os.path.exists('history_manager.exe'):
- # user is running frozen application
- helpers.exec_command('history_manager.exe')
- else:
- # user is running from source
- helpers.exec_command('%s history_manager.py' % sys.executable)
- else:
- # Unix user
- helpers.exec_command('%s history_manager.py' % sys.executable)
+ config_path = '-c %s' % gajim.gajimpaths.config_root
+ posix = os.name != 'nt'
+ if os.path.exists('history_manager.exe'): # Windows
+ helpers.exec_command('history_manager.exe %s' % config_path,
+ posix=posix)
+ else: # Linux or running from Git
+ helpers.exec_command(
+ '%s history_manager.py %s' % (sys.executable, config_path),
+ posix=posix)
def on_manage_bookmarks(self, action, param):
config.ManageBookmarksWindow()
=====================================
src/common/helpers.py
=====================================
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -408,7 +408,7 @@ def is_in_path(command, return_abs_path=False):
pass
return False
-def exec_command(command, use_shell=False):
+def exec_command(command, use_shell=False, posix=True):
"""
execute a command. if use_shell is True, we run the command as is it was
typed in a console. So it may be dangerous if you are not sure about what
@@ -417,7 +417,7 @@ def exec_command(command, use_shell=False):
if use_shell:
subprocess.Popen('%s &' % command, shell=True).wait()
else:
- args = shlex.split(command)
+ args = shlex.split(command, posix=posix)
p = subprocess.Popen(args)
gajim.thread_interface(p.wait)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0b0812bb757b37eb3f5a10c70185602b19…
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits:
13d86057 by Philipp Hörist at 2017-04-21T18:34:54+02:00
Start HistoryManager with config path argument
HistoryManager was not finding the Logs.db when Gajim was used
with the -c config path argument
- - - - -
2 changed files:
- src/common/helpers.py
- src/roster_window.py
Changes:
=====================================
src/common/helpers.py
=====================================
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -405,7 +405,7 @@ def is_in_path(command, return_abs_path=False):
pass
return False
-def exec_command(command, use_shell=False):
+def exec_command(command, use_shell=False, posix=True):
"""
execute a command. if use_shell is True, we run the command as is it was
typed in a console. So it may be dangerous if you are not sure about what
@@ -414,7 +414,7 @@ def exec_command(command, use_shell=False):
if use_shell:
subprocess.Popen('%s &' % command, shell=True).wait()
else:
- args = shlex.split(command.encode('utf-8'))
+ args = shlex.split(command.encode('utf-8'), posix=posix)
p = subprocess.Popen(args)
gajim.thread_interface(p.wait)
=====================================
src/roster_window.py
=====================================
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -2856,13 +2856,15 @@ class RosterWindow:
gajim.connections[account].send_motd(server)
def on_history_manager_menuitem_activate(self, widget):
- if os.name == 'nt':
- if os.path.exists('history_manager.exe'): # user is running stable
- helpers.exec_command('history_manager.exe')
- else: # user is running svn
- helpers.exec_command('%s history_manager.py' % sys.executable)
- else: # Unix user
- helpers.exec_command('%s history_manager.py' % sys.executable)
+ config_path = '-c %s' % gajim.gajimpaths.config_root
+ posix = os.name != 'nt'
+ if os.path.exists('history_manager.exe'): # Windows
+ helpers.exec_command('history_manager.exe %s' % config_path,
+ posix=posix)
+ else: # Linux or running from Git
+ helpers.exec_command(
+ '%s history_manager.py %s' % (sys.executable, config_path),
+ posix=posix)
def on_info(self, widget, contact, account):
"""
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/13d86057c7d2208a2cb8bf06fb738df93a…
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c058a1e1 by André Apitzsch at 2017-04-10T23:48:52+02:00
zeroconf: string.letters has been removed with Python 3
use ascii_letters which should be sufficient
- - - - -
4725858a by André Apitzsch at 2017-04-10T23:53:54+02:00
zeroconf: 'to' is of type JID and no string
use a class method to remove the resource from JID
- - - - -
8e3e9b4d by Philipp Hörist at 2017-04-19T18:55:25+02:00
Merge branch 'zeroconf' into 'master'
fix python errors in client zeroconf
See merge request !82
- - - - -
1 changed file:
- src/common/zeroconf/client_zeroconf.py
Changes:
=====================================
src/common/zeroconf/client_zeroconf.py
=====================================
--- a/src/common/zeroconf/client_zeroconf.py
+++ b/src/common/zeroconf/client_zeroconf.py
@@ -756,7 +756,7 @@ class ClientZeroconf:
if to is None:
# Can’t send undirected stanza over Zeroconf.
return -1
- to = gajim.get_jid_without_resource(to)
+ to = to.getStripped()
stanza.setFrom(self.roster.zeroconf.name)
try:
@@ -801,7 +801,7 @@ class ClientZeroconf:
"""
Generate a random id
"""
- return ''.join(Random().sample(string.letters + string.digits, 6))
+ return ''.join(Random().sample(string.ascii_letters + string.digits, 6))
def RegisterDisconnectHandler(self, handler):
"""
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/14091642c4b5dd33ca280504366b4caac…