Line | |
---|
1 | import xmlrpclib |
---|
2 | import os |
---|
3 | import shutil |
---|
4 | import subprocess |
---|
5 | import socket |
---|
6 | import threading |
---|
7 | |
---|
8 | import LliurexUpCore |
---|
9 | |
---|
10 | from gi.repository import Gtk, Gdk, GObject, GLib, PangoCairo, Pango |
---|
11 | |
---|
12 | import signal |
---|
13 | signal.signal(signal.SIGINT, signal.SIG_DFL) |
---|
14 | |
---|
15 | |
---|
16 | class LliurexUpConnect(): |
---|
17 | """docstring for LliurexUpCore""" |
---|
18 | def __init__(self): |
---|
19 | self.llxUpCore=LliurexUpCore.LliurexUpCore() |
---|
20 | GObject.threads_init() |
---|
21 | self.status=True |
---|
22 | |
---|
23 | |
---|
24 | def canConnectToLliurexNet(self): |
---|
25 | try: |
---|
26 | can_connect=self.llxUpCore.canConnectToLliurexNet() |
---|
27 | if can_connect: |
---|
28 | return True |
---|
29 | else: |
---|
30 | return False |
---|
31 | except Exception, e: |
---|
32 | return e |
---|
33 | |
---|
34 | def isLliurexUpIsUpdated(self): |
---|
35 | try: |
---|
36 | is_lliurexup_update=self.llxUpCore.isLliurexUpIsUpdated() |
---|
37 | return is_lliurexup_update |
---|
38 | |
---|
39 | except Exception, e: |
---|
40 | print e |
---|
41 | return e |
---|
42 | |
---|
43 | |
---|
44 | def installLliurexUp(self): |
---|
45 | try: |
---|
46 | #GLib.timeout_add(100,self.is_running) |
---|
47 | #self.t=threading.Thread(target=self.installing) |
---|
48 | #self.t.daemon=True |
---|
49 | #self.t.start() |
---|
50 | msg=self.llxUpCore.installLliurexUp() |
---|
51 | print "##########" |
---|
52 | print msg |
---|
53 | return msg |
---|
54 | |
---|
55 | except Exception, e: |
---|
56 | return e |
---|
57 | |
---|
58 | #return self.status |
---|
59 | |
---|
60 | |
---|
61 | def check_mirror(self): |
---|
62 | try: |
---|
63 | is_mirror_update=self.llxUpCore.lliurexMirrorIsUpdated() |
---|
64 | return is_mirror_update |
---|
65 | |
---|
66 | except Exception, e: |
---|
67 | print e |
---|
68 | return e |
---|
69 | |
---|
70 | def getPackagesToUpdate(self): |
---|
71 | try: |
---|
72 | print "###########" |
---|
73 | print "HOLA" |
---|
74 | info=[] |
---|
75 | packages=self.llxUpCore.getPackagesToUpdate() |
---|
76 | print "//////////////" |
---|
77 | for item in packages: |
---|
78 | info.append(item) |
---|
79 | |
---|
80 | print info |
---|
81 | |
---|
82 | except Exception, e: |
---|
83 | print e |
---|
84 | return e |
---|
Note: See
TracBrowser
for help on using the repository browser.