Skip to content

Commit 64bf9fb

Browse files
committed
version 2.0.2
1 parent f01d2b5 commit 64bf9fb

File tree

7 files changed

+36
-24
lines changed

7 files changed

+36
-24
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Simply download and execute the setup.exe file
1313

1414
sudo apt-get install python3-pip python3-tk unrar
1515
sudo pip3 install django==1.8.5 irc requests cherrypy pytz miniupnpc
16-
sudo dpkg -i IRCapp_2.0.deb
16+
sudo dpkg -i IRCapp_2.0.2.deb
1717
* In case you choose to clone the source code, for instance if you implement a server, you should run :
1818

1919
sudo apt-get install python3-pip python3-tk unrar
@@ -42,4 +42,9 @@ A few major things still need to be done:
4242
* Change: the download directory is now selected via a menu
4343
* A few other things probably too...
4444

45+
###Changelog 2.0.2 (since 2.0) :
46+
* Fix: clicking on the file name in the download now properly opens the file location
47+
* Fix: displays an error when trying to change the download directory while downloading
48+
* Fix: added a download_directory to the config.ini, to be used in case the GUI doesn't work properly (couldn't yet find why)
49+
4550

config.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ip_address = 127.0.0.1 #this is the ip address used by the WSGI server
22
port = 8020 #this is the port used by the WSGI server
3-
port_forwarding = #use this if automatic UPnP port forwarding doesn't work -> open port manually on your router
3+
port_forwarding = #use this if automatic UPnP port forwarding doesnt work -> open port manually on your router
44
timezone = Europe/Paris #check : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for all valid timezones
5+
download_directory = /home/mrj/Documents/family #add full path if GUI doesnt work

core/logs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
from django.utils.translation import ugettext as _
33
import os, sys
44
from core.models import Download_Path
5+
import settings
56

67
def directory():
78
if Download_Path.objects.all().count() == 0:
89
#temporary solution to get download path for english, german and french speaking users to avoid third party dependancy
910
default = os.path.join(os.path.expanduser('~'), _('Downloads'))
1011
if not os.path.exists(default):
11-
default = os.path.join(os.path.expanduser('~'), _('Téléchargements'))
12+
default = os.path.join(os.path.expanduser('~'), 'Téléchargements')
13+
#config.ini file has priority
14+
with open(os.path.join(settings.BASE_DIR, "config.ini"), "r") as cfg:
15+
content = cfg.readlines()
16+
path = content[4][1+content[4].index("="):content[4].index("#")].strip(" ")
17+
cfg.close()
18+
if path:
19+
default = path
1220
if os.path.exists(default):
1321
Download_Path(download_path=default).save()
1422
return Download_Path.objects.latest('id').download_path

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
setup(name='ircapp',
5-
version='2.0',
5+
version='2.0.2',
66
author='MrJ',
77
description='Simple IRC Client',
88
license='MIT',

setupcx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name = 'IRCapp',
29-
version = '2.0',
29+
version = '2.0.2',
3030
description = 'Simple IRC app based on irclib',
3131
author = 'MrJ',
3232
options = {'build_exe': {'include_files':includefiles, 'packages':packages, "excludes": ['pytz', 'core'], "include_msvcr" : include_msvcr}},

templates/search.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<!-- </div> -->
7878
<div style="text-align:center;padding-top:60px" class="mdl-card__supporting-text">
7979
<img style="margin-right:8px;margin-bottom:8px" src="{{STATIC_URL}}ic_ircapp_logo_bluegray.svg" height="32px"><br>
80-
v<strong>2.0</strong> &middot; <a style="text-decoration:underline;cursor:pointer;" target="_blank" href="/log/">Log file</a><br><br>
80+
v<strong>2.0.1</strong> &middot; <a style="text-decoration:underline;cursor:pointer;" target="_blank" href="/log/">Log file</a><br><br>
8181
<strong>Code by MrJ &middot; Art by Schickele</strong><br>
8282
Inspired by the search king’s dev site<br>
8383
&copy; 2015–2016 &middot; <a target="_blank" href="{{STATIC_URL}}ircapp_gua.txt">License (MIT)</a><br><br>
@@ -203,6 +203,7 @@
203203
Download directory: <a id="base_folder" title="Double click to change">{{directory}}</a>
204204
{% endif %}
205205
<div style="display: none;" id="nospacediv">Insufficient harddrive space to download the file, please make some and click "home" afterwards</div>
206+
<div style="display: none;" id="path_msg"></div>
206207
<span id="free_sp">{{free_space}} GB free <img style="display: none;" id='space_warning' src='{{STATIC_URL}}ic_warning_red.svg' heitgh="18px"></span>
207208
<br>
208209
<div id="downbox_options">
@@ -553,6 +554,7 @@
553554
Getspace(false);
554555
} else {
555556
$("#path_msg").html(data.error);
557+
$("#path_msg").show();
556558
}
557559
},
558560
error: function( jqXHR, textStatus ) {
@@ -643,14 +645,9 @@
643645
});
644646

645647
$('#down').on('click', '#opendir', function(event) {
646-
var self = $(this).parent();
647-
myclass = $(this).attr('class');
648-
if ( myclass === "history" ){
649-
var pk = self.attr('id');
650-
$.get( "/opendir/", { pk : pk } );
651-
} else {
652-
$.get( "/opendir/", { pk : 0 } );
653-
}
648+
var self = $(this).parent(),
649+
myclass = self.parent().parent().parent().attr('id');
650+
$.get( "/opendir/", { pk : self.attr('id'), myclass : myclass } );
654651
});
655652
$('#close_download_box').click(function(event) {
656653
$("#down").hide();
@@ -982,7 +979,7 @@
982979
var new_tr = [];
983980
new_tr.push(
984981
"<tr class='mainrow'>" +
985-
"<td><td><td><td rowspan='2'><img id='delete_pic' src='{{STATIC_URL}}ic_cancel_red.svg'></td>" +
982+
"<td id='opendir'><td><td><td rowspan='2'><img id='delete_pic' src='{{STATIC_URL}}ic_cancel_red.svg'></td>" +
986983
"</tr>" +
987984
"<tr><td><td><td>"+
988985
"<div class='progressbox' style='display: none;'>"+

views.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -551,16 +551,16 @@ def splitext(path):
551551
return os.path.splitext(path)
552552

553553
def opendir(request):
554-
pk = int(request.GET['pk'])
555-
try:
556-
basefolder = Download_Path.objects.latest('id').download_path
554+
pk, myclass = int(request.GET['pk']), request.GET['myclass']
555+
if directory():
556+
basefolder = directory()
557557
foldername = basefolder
558-
if pk != 0:
558+
if myclass == "history":
559559
fileobject = Download_History.objects.get(pk=pk)
560560
if "extracted" in fileobject.status and ".tar" in splitext(fileobject.filename)[1]:
561-
foldername = os.path.join(basefolder, splitext(fileobject.filename)[0])
561+
foldername = os.path.join(basefolder, splitext(fileobject.filename)[0])
562562
else:
563-
fileobject = Download_Ongoing.objects.latest('id')
563+
fileobject = Download_Ongoing.objects.get(pk=pk)
564564
if "Extracting" in fileobject.status and ".tar" in splitext(fileobject.filename)[1]:
565565
foldername = os.path.join(basefolder, '_UNPACK_' + splitext(fileobject.filename)[0])
566566
elif "extracted" in fileobject.status and ".tar" in splitext(fileobject.filename)[1]:
@@ -570,9 +570,10 @@ def opendir(request):
570570
else:
571571
opener ="open" if sys.platform == "darwin" else "xdg-open"
572572
subprocess.call([opener, foldername])
573-
return HttpResponse("")
574-
except Exception as e:
575-
return HttpResponse("Error: %s" % e)
573+
return HttpResponse("succefully opened directory")
574+
else:
575+
return HttpResponse("No directory set to open dir")
576+
576577

577578
def read_log(request):
578579
log_file = open(log().my_log)

0 commit comments

Comments
 (0)