gitso

gitso Commit Details


Date:2008-10-26 16:29:55 (16 years 1 month ago)
Author:gerberad
Branch:master
Commit:3877897f2c0cf854621b74c96f30b78bc40fa03b
Parents: e0d98c072f51ff6d89ba7bcd87d11ae95dafd579
Message:Rewrote AboutWindow, implemented --list, added scripts for the linux stand-alone version and updated build script to make the stand-alone tarball.

Changes:

File differences

gitso/trunk/AboutWindow.py
11
2
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
335
436
537
......
1951
2052
2153
22
23
24
2554
26
27
28
29
55
3056
31
57
58
3259
33
34
35
36
60
61
62
63
3764
38
39
65
66
67
68
4069
41
42
43
44
45
70
71
72
73
74
75
4676
47
48
49
50
51
77
78
79
80
5281
5382
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
54120
55121
56122
123
57124
58125
59126
import wx
import os, os.path, sys
import os, os.path, sys, cStringIO
class InfoPage(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
infostring = "Authors:" + "\n\tAaron Gerber\n\tDerek Buranen"
infostring = infostring + "\n\nContributors:" + "\n\tNick Verbeck"
infostring = infostring + "\n\nCopyright 2007 - 2008"
info = wx.TextCtrl(self, -1, infostring, style=wx.TE_MULTILINE | wx.ST_NO_AUTORESIZE)
pagesizer = wx.BoxSizer(wx.VERTICAL);
pagesizer.Add(info, 1, wx.EXPAND)
self.SetSizer(pagesizer);
pagesizer.SetSizeHints(self);
class LicensePage(wx.Panel):
def __init__(self, parent, paths):
wx.Panel.__init__(self, parent)
license = open(paths['copyright'], 'r')
copyright = wx.TextCtrl(self, -1, license.read(), style=wx.TE_MULTILINE | wx.ST_NO_AUTORESIZE)
copyright.SetEditable(False)
pagesizer = wx.BoxSizer(wx.VERTICAL);
pagesizer.Add(copyright, 1, wx.EXPAND);
self.SetSizer(pagesizer);
pagesizer.SetSizeHints(self);
class AboutWindow(wx.Frame):
"""
icon = wx.Icon(os.path.join(paths['main'], 'icon.ico'), wx.BITMAP_TYPE_ICO)
self.SetIcon(icon)
# Create a read-only box
license = open(paths['copyright'], 'r')
if sys.platform == 'win32':
self.SetBackgroundColour(wx.Colour(236,233,216))
self.copyright = wx.TextCtrl(self, -1, license.read(), pos=wx.Point(0, 180), size=wx.Size(525, 160), style=wx.TE_MULTILINE | wx.ST_NO_AUTORESIZE)
self.copyright.SetEditable(False)
SetBackgroundColour(wx.Colour(236,233,216))
self.text1 = wx.StaticText(self, wx.ID_ANY, 'Gitso', pos=wx.Point(0, 13), size=wx.Size(525, 35), style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
## Headings ##
text1 = wx.StaticText(self, wx.ID_ANY, 'Gitso')
font1 = wx.Font(24, wx.NORMAL, wx.NORMAL, wx.BOLD)
self.text1.SetFont(font1)
self.text2 = wx.StaticText(self, -1, "Gitso is to Support Others", pos=wx.Point(0, 48), size=wx.Size(525, 27), style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
self.text3 = wx.StaticText(self, -1, "Version 0.5", pos=wx.Point(0, 72), size=wx.Size(525, 27), style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
text1.SetFont(font1)
text2 = wx.StaticText(self, -1, "Gitso is to Support Others")
text3 = wx.StaticText(self, -1, "Version 0.6")
font2 = wx.Font(16, wx.NORMAL, wx.NORMAL, wx.NORMAL)
self.text2.SetFont(font2)
self.text3.SetFont(font2)
font3 = wx.Font(12, wx.NORMAL, wx.NORMAL, wx.NORMAL)
text2.SetFont(font2)
text3.SetFont(font3)
url = wx.HyperlinkCtrl(self, -1, "code.google.com/p/gitso", "http://code.google.com/p/gitso")
self.text4 = wx.StaticText(self, -1, "Copyright 2008", pos=wx.Point(0, 102), size=wx.Size(525, 27), style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
self.text5 = wx.StaticText(self, -1, "Aaron Gerber and Derek Buranen", pos=wx.Point(0, 125), size=wx.Size(525, 27), style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
font4 = wx.Font(14, wx.NORMAL, wx.NORMAL, wx.NORMAL)
self.text4.SetFont(font4)
self.text5.SetFont(font4)
data = open(os.path.join(paths['main'], 'icon.png'), "rb").read()
stream = cStringIO.StringIO(data)
img = wx.ImageFromStream(stream)
img.Rescale(150, 150)
bmp = wx.BitmapFromImage(img)
image1 = wx.StaticBitmap(self, -1, bmp)
self.url = wx.HyperlinkCtrl(self, -1, "code.google.com/p/gitso", "http://code.google.com/p/gitso", wx.Point(189, 150))
self.ok = wx.Button(self, wx.ID_OK, "OK", wx.Point(425, 350))
self.SetDefaultItem(self.ok)
self.ok.SetFocus()
## Buttons ##
ok = wx.Button(self, wx.ID_OK, "OK")
self.SetDefaultItem(ok)
ok.SetFocus()
wx.EVT_BUTTON(self, wx.ID_OK, self.CloseAbout)
## Sizers ##
topsizer = wx.BoxSizer(wx.VERTICAL);
info_sizer = wx.BoxSizer(wx.VERTICAL);
info_sizer.Add(text1, 0, wx.ALIGN_CENTER | wx.ALL, 7);
info_sizer.Add(text2, 0, wx.ALIGN_CENTER | wx.ALL, 3);
info_sizer.Add(text3, 0, wx.ALIGN_CENTER | wx.ALL, 3);
info_sizer.Add(url, 0, wx.ALIGN_CENTER | wx.ALL, 3);
heading_sizer = wx.BoxSizer(wx.HORIZONTAL);
heading_sizer.Add(image1, 0, wx.ALIGN_LEFT | wx.ALL, 10 );
heading_sizer.Add(info_sizer, 0, wx.ALL, 10 );
topsizer.Add(heading_sizer, 0, wx.ALIGN_CENTER);
## Tabs ##
nb = wx.Notebook(self, size=wx.Size(525,220))
license_page = LicensePage(nb, paths)
info_page = InfoPage(nb)
nb.AddPage(info_page, "Authors")
nb.AddPage(license_page, "License")
tab_sizer = wx.BoxSizer(wx.HORIZONTAL);
tab_sizer.Add(nb, 1, wx.EXPAND | wx.ALL, 10 );
topsizer.Add(tab_sizer, 1, wx.ALIGN_RIGHT );
## Buttons ##
button_sizer = wx.BoxSizer(wx.HORIZONTAL);
button_sizer.Add(ok, 0, wx.ALL, 10 );
topsizer.Add(button_sizer, 0, wx.ALIGN_RIGHT );
## Final settings ##
self.SetSizer(topsizer);
topsizer.SetSizeHints(self);
self.SetThemeEnabled(True)
self.Centre()
self.Show()
def CloseAbout(self, event):
self.Close()
gitso/trunk/ArgsParser.py
1010
1111
1212
13
13
14
1415
1516
1617
......
2122
2223
2324
25
26
2427
2528
2629
......
5053
5154
5255
53
56
57
58
59
60
5461
5562
5663
5764
5865
5966
60
67
68
69
70
71
72
73
74
75
76
77
78
79
6180
6281
6382
......
83102
84103
85104
86
105
87106
88107
89108
90109
91110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@copyright: 2007-2008
"""
import os, sys, signal, os.path
import os, sys, signal, os.path, urllib
class ArgsParser:
def __init__(self):
# Initialize Self.paths here.
self.paths['main'] = ''
self.paths['listen'] = False
self.paths['connect'] = ''
self.paths['list'] = []
if sys.platform.find('linux') != -1:
self.paths['main'] = os.path.join(sys.path[0], '..', 'share', 'gitso')
elif sys.argv[i] == '--connect': # --connect
i = i + 1
if i >= len(sys.argv) or self.paths['listen']:
if i >= len(sys.argv):
print "Error: No IP or domain name given."
self.HelpMenu()
if self.paths['listen']:
print "Error: --connect and --listen can not be used at the same time."
self.HelpMenu()
if sys.argv[i][0] + sys.argv[i][1] <> "--":
self.paths['connect'] = sys.argv[i]
else:
print "Error: '" + sys.argv[i] + "' is host with '--connect'."
print "Error: '" + sys.argv[i] + "' is not a valid host with '--connect'."
self.HelpMenu()
elif sys.argv[i] == '--list': # --list
i = i + 1
if i >= len(sys.argv):
print "Error: No List file given."
self.HelpMenu()
if sys.argv[i][0] + sys.argv[i][1] <> "--":
self.paths['list'] = self.getHosts(sys.argv[i])
else:
print "Error: '" + sys.argv[i] + "' is not a valid list with '--list'."
self.HelpMenu()
else:
print " --dev\t\tSet self.paths for development."
print " --listen\t\tlisten for incoming connections."
print " --connect {IP|DN}\tConnects to host (support giver)."
print " --list {URL|LIST}\tAlternative Support list."
print " --list {URL|FILE}\tAlternative Support list."
print " --help\t\tThis Menu."
exit(0)
def GetPaths(self):
return self.paths
def getHosts(self, file):
list = []
fileList = ""
if len(file) > 3:
prefix = file[0] + file[1] + file[2] + file[3]
else:
prefix = ""
if prefix == "www." or prefix == "http":
handle = urllib.urlopen(file)
fileList = handle.read()
handle.close()
else:
if os.path.exists(file):
handle = open(file, 'r')
fileList = handle.read()
handle.close()
parsedlist = fileList.split(",")
for i in range(0, len(parsedlist)):
if self.validHost(parsedlist[i].strip()):
list.append(parsedlist[i].strip())
return list
def validHost(self, host):
if host != "" and host.find(";") == -1 and host.find("/") == -1 and host.find("'") == -1 and host.find("`") == -1 and len(host) > 6:
return True
else:
return False
gitso/trunk/ConnectionWindow.py
6161
6262
6363
64
64
6565
6666
6767
......
122122
123123
124124
125
126125
127126
128127
......
303302
304303
305304
306
305
307306
308307
309308
# the combobox Control
self.sampleList = []
self.sampleList = self.paths['list']
self.sampleList = self.getHosts(self.sampleList, os.path.join(self.paths['main'], 'hosts.txt'))
self.sampleList = self.getHosts(self.sampleList, self.paths['preferences'])
self.hostField.Value = self.paths['connect']
self.ConnectSupport(None)
def RadioToggle(self, event):
"""
Toggles Radio Buttons
self.thread.setHost(host)
self.thread.start()
# If you don't wait 2 seconds, the interface won't reload and it'll freeze.
# If you don't wait 1+ seconds, the interface won't reload and it'll freeze.
# Possibly on older systems you should wait longer, it works fine on mine...
time.sleep(1)
gitso/trunk/arch/linux/README-stand-alone.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Gitso is to support others.
We created Gitso as a frontend to reverse VNC connections. It is meant
to be a simple two-step process that connects one person to another's
screen. First, the support person offers to give support. Second, the
person who needs help connects and has their screen remotely visible.
Because Gitso is cross-platform (Ubuntu, OS X and Windows) and uses a
reverse VNC connection, it greatly simplifies the process of getting support.
Gitso 0.5: "Kill the Undead". (September 5, 2008)
* Complete rewrite of the interface to wxWidgets (from GTK).
* Gitso no longer has Zombied VNC processes after it quits.
* Gitso stops the VNC process when it closes (OS X & Linux)
* Updated Icon
* Updated License: GPL 3
* Added Support to specify a list of hosts when you distribute it.
* Added History/Clear History of servers
* Added OS X 10.5 Support (needs testing on 10.4 and 10.3)
o OS X uses TightVNC 1.3.9 (Source)
o OS X uses OSXvnc 3.0 (Source)
* Added Windows XP Support
o Windows uses TightVNC 1.3.9 (Source)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gitso Distro-independent Code.
Note: If you run Ubuntu, it'd be easier to use gitso_0.5_all.deb. However,
if you aren't running Ubuntu proceed.
Requirements:
x11vnc
vncviewer
wxPython
Usage: ./run-gitso.sh [options]
Options:
--have-wxpython:Disable wxPython library check
gitso/trunk/arch/linux/gitso.1
3434
3535
3636
37
37
3838
3939
4040
.B --list
Alternative support list, where
.I list
is either a URL of a remote file list or a comma seperated list
is either a URL of a remote file or path to local file.
.TP
.B --help
Display the help menu.
gitso/trunk/arch/linux/run-gitso.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash
if test "$1" == "-h" -o "$1" == "--help"; then
echo -e "Usage: ./run-gitso.sh [options]"
echo -e "\tOptions:"
echo -e "\t--have-wxpython:\tDisable wxPython library check"
exit 0
fi
## Checking for x11vnc
if test ! "`which x11vnc`"; then
echo -e "Error - x11vnc was not found on your system.\n"
exit 1
fi
## Checking for wxpython
if test "$1" != "--have-wxpython"; then
if test ! "`locate wxPython/lib`"; then
echo -e "\nError - wxPython was not found on your system."
echo -e "\nIf you know you have wxPython installed, use '--have-wxpython'.\n\tExample: ./run-gitso --have-wxpython\n"
exit 1
fi
else
echo -e "\nBypassing wxpython check..."
fi
## Checking for vncviewer
if test ! "`which vncviewer`"; then
echo -e "\nError - vncviewer was not found on your system.\n"
exit 1
fi
echo -e "Starting Gitso..."
bin/gitso
gitso/trunk/makegitso.sh
5555
5656
5757
58
5859
60
5961
6062
6163
64
6265
6366
6467
......
7982
8083
8184
85
8286
8387
8488
......
8993
9094
9195
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
92117
93118
94119
120
121
95122
96123
97
98124
elif test "`uname -a 2>&1 | grep Linux | grep -v which`"; then
DEB="gitso_0.6_all.deb"
TARGZ="gitso_0.6_all.tar.gz"
BUILDPATH="gitso"
TARGZPATH="Gitso"
echo -n "Creating $DEB"
rm -rf $BUILDPATH
# Deb version of Gitso.
mkdir -p $BUILDPATH/DEBIAN
mkdir -p $BUILDPATH/usr/bin
mkdir -p $BUILDPATH/usr/share/applications
cp __init__.py $BUILDPATH/usr/share/$BUILDPATH/
cp hosts.txt $BUILDPATH/usr/share/$BUILDPATH/
cp icon.ico $BUILDPATH/usr/share/$BUILDPATH/
cp icon.png $BUILDPATH/usr/share/$BUILDPATH/
echo -n ".."
cp arch/linux/gitso.desktop $BUILDPATH/usr/share/applications/
echo -n ".."
dpkg -b $BUILDPATH/ $DEB 2>&1 > /dev/null
echo -e " [done]"
# Standalone version of Gitso.
echo -n "Creating $TARGZ"
rm -rf $TARGZPATH
cp -r $BUILDPATH $TARGZPATH
rm -rf $TARGZPATH/DEBIAN
echo -n ".."
cp arch/linux/README-stand-alone.txt $TARGZPATH/README
cp arch/linux/run-gitso.sh $TARGZPATH/
mv $TARGZPATH/usr/bin $TARGZPATH/bin
mv $TARGZPATH/usr/share $TARGZPATH/share
rm -rf $TARGZPATH/usr/
echo -n "."
tar -cvzf $TARGZ $TARGZPATH 2>&1 > /dev/null
echo -e " [done]\n"
if [ "$CLEAN" = "yes" ]; then
rm -rf $BUILDPATH
rm -rf $TARGZPATH
find . -name "*.pyc" -exec rm {} ';'
fi
echo -e " [done]\n"
fi

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.07938s using 13 queries.