made project portable, just symlink executable to PATH
parent
46ecc8ed04
commit
3725629ada
|
@ -3,12 +3,10 @@
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk, Gdk
|
from gi.repository import Gtk, Gdk
|
||||||
|
|
||||||
from rsrc.Scraper import proxylister, searcher
|
from rsrc.Scraper import proxylister, searcher
|
||||||
|
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
def __init__(self, config_file):
|
def __init__(self, config_file):
|
||||||
|
@ -98,7 +96,7 @@ class Scallywag:
|
||||||
def __init__(self, configFile):
|
def __init__(self, configFile):
|
||||||
self.config = Config( configFile )
|
self.config = Config( configFile )
|
||||||
|
|
||||||
self.gladefile = "./rsrc/gui/winMain.glade"
|
self.gladefile = "{0}/rsrc/gui/winMain.glade".format(os.path.dirname(os.path.realpath(__file__)))
|
||||||
self.builder = Gtk.Builder()
|
self.builder = Gtk.Builder()
|
||||||
self.builder.add_from_file(self.gladefile)
|
self.builder.add_from_file(self.gladefile)
|
||||||
self.builder.connect_signals(self)
|
self.builder.connect_signals(self)
|
||||||
|
@ -134,6 +132,7 @@ class Scallywag:
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main = Scallywag("config.ini")
|
parent_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
main = Scallywag("{0}/config.ini".format(parent_dir))
|
||||||
|
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -71,7 +71,7 @@ class Scraper:
|
||||||
results_buffer = list()
|
results_buffer = list()
|
||||||
|
|
||||||
for tr in resultsTable_xpath:
|
for tr in resultsTable_xpath:
|
||||||
title = tr.xpath('td[2]/div[1]/a[1]/text()')[0]
|
title = tr.xpath('td[2]/div[1]/a[1]/text()')
|
||||||
seeders = tr.xpath('td[3]/text()')[0]
|
seeders = tr.xpath('td[3]/text()')[0]
|
||||||
leechers = tr.xpath('td[4]/text()')[0]
|
leechers = tr.xpath('td[4]/text()')[0]
|
||||||
author = tr.xpath('td[2]/font/a/text()')
|
author = tr.xpath('td[2]/font/a/text()')
|
||||||
|
|
Loading…
Reference in New Issue