ftp_manager. text in progressbar
This commit is contained in:
@@ -188,9 +188,7 @@
|
||||
<object class="GtkHBox" id="hbox15">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="progressbar">
|
||||
<property name="ellipsize">end</property>
|
||||
</object>
|
||||
<object class="GtkProgressBar" id="progressbar"/>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
@@ -201,35 +199,12 @@
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="inslall_upgrade_button">
|
||||
<property name="label" translatable="yes">install/upgrade</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="on_inslall_upgrade_clicked"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-refresh</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Install/Upgrade</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
||||
@@ -301,15 +301,21 @@ class Ftp(threading.Thread):
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.ftp = ftplib.FTP('dicson.no-ip.info')
|
||||
gobject.idle_add(self.progressbar.set_text,
|
||||
'Connecting to server')
|
||||
self.ftp = ftplib.FTP('dicson.no-ip.info')#ftp.gajim.org')
|
||||
self.ftp.login()
|
||||
self.ftp.cwd('plugins')
|
||||
if not self.remote_dirs:
|
||||
self.plugins_dirs = self.ftp.nlst()
|
||||
progress_step = 1.0 / len(self.plugins_dirs)
|
||||
gobject.idle_add(self.progressbar.set_text,
|
||||
'Scan files on the server')
|
||||
for dir_ in self.plugins_dirs:
|
||||
fract = self.progressbar.get_fraction() + progress_step
|
||||
gobject.idle_add(self.progressbar.set_fraction, fract)
|
||||
gobject.idle_add(self.progressbar.set_text,
|
||||
'Read "%s"' % dir_)
|
||||
try:
|
||||
self.ftp.retrbinary('RETR %s/manifest.ini' %dir_,
|
||||
self.handleDownload)
|
||||
@@ -341,6 +347,8 @@ class Ftp(threading.Thread):
|
||||
def download_plugin(self):
|
||||
gobject.idle_add(self.progressbar.show)
|
||||
self.pulse = gobject.timeout_add(150, self.progressbar_pulse)
|
||||
gobject.idle_add(self.progressbar.set_text,
|
||||
'Create a list of files')
|
||||
for remote_dir in self.remote_dirs:
|
||||
|
||||
def nlstr(dir_, subdir=None):
|
||||
@@ -383,6 +391,8 @@ class Ftp(threading.Thread):
|
||||
|
||||
# downloading files
|
||||
for filename in files:
|
||||
gobject.idle_add(self.progressbar.set_text,
|
||||
'Downloading "%s"' % filename)
|
||||
full_filename = os.path.join(local_dir, filename)
|
||||
try:
|
||||
self.ftp.retrbinary('RETR /%s' % filename,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[info]
|
||||
name: Ftp Manager
|
||||
short_name: ftp_manager
|
||||
version: 0.1.1
|
||||
version: 0.1
|
||||
description: Install and upgrade plugins from ftp
|
||||
authors: Denis Fomin <fominde@gmail.com>
|
||||
homepage: http://trac-plugins.gajim.org/wiki/
|
||||
|
||||
Reference in New Issue
Block a user