Commit b51c620d authored by nextime's avatar nextime

Added 0.1 branch

parent de40190a
- change platform module calls with skylive.genutils.platform()
platform.system():
Solaris: 'SunOS'
Linux: 'Linux'
OSX: 'Darwin'
FreeBSD: 'FreeBSD'
Windows: 'Windows' or 'Microsoft'
OpenBSD: 'OpenBSD'
NetBSD: 'NetBSD'
This diff is collapsed.
#!/bin/bash
find . -name '*~' -exec rm {} \;
find . -name '*.pyc' -exec rm {} \;
skyliveng (0.1.5-1) unstable; urgency=low
* New Release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Tue, 26 May 2009 17:14:33 +0200
skyliveng (0.1.3-1) unstable; urgency=low
* New release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Thu, 12 Feb 2009 14:48:51 +0100
skyliveng (0.1.2-2) unstable; urgency=low
* New release.
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Thu, 29 Jan 2009 15:15:37 +0100
skyliveng (0.1.2-1) unstable; urgency=low
* New release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Thu, 11 Dec 2008 21:03:38 +0100
skyliveng (0.1-7) unstable; urgency=low
* Renumbering version
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Sun, 29 Jun 2008 18:14:25 +0200
skyliveng (0.1rc6-1) unstable; urgency=low
* new Release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Sun, 29 Jun 2008 18:11:49 +0200
skyliveng (0.1rc5-3) unstable; urgency=low
* Menus!
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Sun, 29 Jun 2008 18:02:59 +0200
skyliveng (0.1rc5-2) unstable; urgency=low
* Bugfix
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Sun, 29 Jun 2008 17:16:58 +0200
skyliveng (0.1RC5-1) unstable; urgency=low
* New upstream release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Sun, 29 Jun 2008 17:06:33 +0200
skyliveng (0.1b-1) unstable; urgency=low
* New upstream release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Mon, 18 Feb 2008 02:00:23 +0100
skyliveng (0.1-6) unstable; urgency=low
* Added python-imaging dependency
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Tue, 18 Dec 2007 15:07:44 +0100
skyliveng (0.1-5) unstable; urgency=low
* Nocomment.
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Mon, 17 Dec 2007 22:48:50 +0100
skyliveng (0.1-4) unstable; urgency=low
* I hope this is the latest bug
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Mon, 17 Dec 2007 22:40:51 +0100
skyliveng (0.1-3) unstable; urgency=low
* Another one
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Mon, 17 Dec 2007 22:34:28 +0100
skyliveng (0.1-2) unstable; urgency=low
* Fix dependency bug
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Mon, 17 Dec 2007 22:26:52 +0100
skyliveng (0.1-1) unstable; urgency=low
* Initial release
-- Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it> Mon, 17 Dec 2007 22:04:32 +0100
Source: skyliveng
Section: astronomy
Priority: extra
Maintainer: Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Package: skyliveng
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, python, python-wxgtk2.6|python-wxgtk2.8, python-crypto, python-pycard, python-pyfits, python-imaging, python-numpy, python-twisted, python-openssl|python-pyopenssl, python-lxml, python-gst0.10, gstreamer0.10-fluendo-mp3, liboggz1, libgnomevfs2-extra
Suggests: python-psyco
Description: Skylive client (www.skylive.it)
Skylive project client to administer remote telescopes
of skylive (www.skylive.it)
This package was debianized by unknown <Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it>> on
Mon, 17 Dec 2007 22:04:32 +0100.
It was downloaded from http://www.astronomix.org/trac/wiki/SkyliveNG
Upstream Author(s):
Franco Lanza <nextime@nexlab.it>
Sandro Aliano <ita595@hotmail.com>
Copyright:
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
License:
GPLv3: read the file /usr/share/doc/skyliveng/LICENSE.txt
The Debian packaging is (C) 2007, unknown <Unixmedia S.r.l. (Medianix Devel) <devel@unixmedia.it>> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
usr/bin
usr/share
usr/share/applications
src/LICENSE.txt
src/README.txt
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
#$(MAKE)
#docbook-to-man debian/skyliveng.sgml > skyliveng.1
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/skyliveng.
#$(MAKE) DESTDIR=$(CURDIR)/debian/skyliveng install
mkdir -p $(CURDIR)/debian/skyliveng/usr/share/skylive
cp -ap $(CURDIR)/src/appcomponents $(CURDIR)/src/gui $(CURDIR)/src/ICONA.ico \
$(CURDIR)/src/proxyconf.py $(CURDIR)/src/skylive-ng.py $(CURDIR)/src/fitsopener.py \
$(CURDIR)/debian/skyliveng/usr/share/skylive/
cp -ap $(CURDIR)/src/gui $(CURDIR)/src/skylive \
$(CURDIR)/debian/skyliveng/usr/share/skylive/
cp -ap $(CURDIR)/debian/skylive.sh $(CURDIR)/debian/skyliveng/usr/bin/skylive
chmod +x $(CURDIR)/debian/skyliveng/usr/bin/skylive
cp -ap $(CURDIR)/src/skyliveng.desktop $(CURDIR)/debian/skyliveng/usr/share/applications
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
# dh_install
dh_installmenu
dh_desktop
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
#!/bin/sh
cd /usr/share/skylive
./skylive-ng.py $@ > /dev/null 2>&1
?package(skyliveng):needs="X11" section="Applications/Science/Astronomy"\
title="SkyLive NG" command="/usr/bin/skylive"
HTTP Transport for the Skylive Protocol overview:
-------------------------------------------------
CLIENT SERVER
=================================================================|
_________________________________________ |
| |
------ GET /new -------> | Initialization new |
<----- TOKEN ------------ | connection | Request for a new
_________________________________________| | Connection
|
_________________________________________ |
| |
------ POST /auth -------> | Authentication |
<-------- OK|kO ---------- | phase |
_________________________________________| |
|
============================================================================================
_________________________________________ |
| |
------ POST /client -----> | Client -> Server |
<-------- OK|KO -------- | communication channel | Connection established
_________________________________________| | data channels
|
_________________________________________ |
| |
------ POST /server -----> | Server -> Client |
<-------- DATA ----------- | communication channel |
_________________________________________| |
|
=================================================================|
Description:
All the requests are encapsulated in a XML protocol to be definied.
Now we will use some example tags, they are not stable now.
Note: we use an authentication mechanism to establish our tunnel not for the real
communication of user credential, but only to get a way to generate a key for
encrypt the data inside the tunnel with a know key for both the peers without
passing it on in clear text on the tunnel layer.
To do this we need to have something that both parts know before they
try to establish a connection, and the only secrets things they know
are the username ( that can't be used alone cause it pass over the protocol
in clear text) and the hash of the password ( that never pass in clear ).
Other transport (like the SSL/TLS one) can't need to pass
user/password information, so, the encapsulated protocol
will need another and indipendent authentication mechanism.
Maybe we will try to find another solution in future.
Note 2: we try to use HTTP/1.1 to get more probability to
have a working Keep-Alive HTTP support by our proxy.
------------------------------
Initialization new connection:
------------------------------
* Client Request:
---------------
GET /new HTTP/1.1
- Only to start a new connection.
* Server response:
----------------
<response><token>TOKEN</token></response>
- TOKEN is an unique id generated by the server and used by the client
to identify a unique "connection". it is generated
---------------------
Authentication phase:
---------------------
* Client Request:
---------------
POST /auth HTTP/1.1
- Data:
o token=TOKEN (the one generated by the server in initialization)
o user=USERNAME
o hash=HASH (where HASH is the md5sum of a string composed
by the TOKEN, USERNAME and the storated hash of the password)
* Server Response:
----------------
<response><auth>OK|KO</auth></response>
------------------------------
Data channel Client -> Server:
------------------------------
The client make a request that emulate a POST of a file with a fixed size.
When the size of the transfer will reach the size limit or if the upload in any way
blocked and the connection goes down, it will re-establish a new one
in a loop.
Also, we will maybe need to have a sort of keep-alive "ping-pong" system, but it can be
demanded on the encapsulated protocol, like a sort of error correction and/or
checksum for every bit of real communication in the encapsulated protocol.
* Client Request:
---------------
POST /client HTTP/1.1
- Data:
o token=TOKEN
o data=DATA (where DATA is our encapsulated protocol encrypted with AES256 and encryption key
generated by md5sum of token+hash of the password, packetized(1) and in base64)
* Server Response:
----------------
<response><client>OK|NO</client></response>
------------------------------
Data channel Server -> Client:
------------------------------
The client make a request that emulate the download of a big file. It is the exact
opposite with the client->server data channel, but with the same checksum, ping and other
considerations.
* Client Request:
---------------
POST /server HTTP/1.1
- Data:
o token=TOKEN
o data=DATA (where DATA is used to check the identity of the client and is
the token+the hash of the password encrypted in aes256 using the md5sum of
the token+username+the hash of the password as key for encryption
in base64)
* Server Response:
----------------
an emulated file download stream of the data encrypted with aes256 with the md5sum of
token+hash of the password as key, packetized(1) and in base64
--------------------
NOTE #1. Packetized:
--------------------
We choose to encrypt our data cause is the best way to be sure that noone can takeover our tunnel.
If we want to bypass at leas any proxy, we can't simply use SSL/TLS, cause
we need to appears to the proxy like a normal http request in clear text, at least
more close to a normal http stream that we can.
every splice of data is encrypted in AES256. As we don't know the exact lenght of any
splice of data, and aes256 can't decrypted dinamically, we need another way to
know when to decrypt our data.
So, we will "packetize" it in our data stream by converting every packet to
base64, and we insert a separator to let's both client and server recognize where a packet
is complete and need to be decrypted.
TODO: Choose a separator!
ISSUE: won't this way to transport data add too many overhead? Isn't better to simply
use connectSSL on the client and listenSSL on the server, and encapsulate the
stream a clear text simple http tunnel? But this way, how we can have the client ip
on the server side?
just a TCP connection over SSL
using listenSSL and connectSSL
twisted reactor methods instead of
listenTCP and connectTCP.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>XiphQT</string>
<key>CFBundleGetInfoString</key>
<string>Xiph QuickTime Components 0.1.8, Copyright © 2005-2007 Arek Korbik</string>
<key>CFBundleIdentifier</key>
<string>org.xiph.xiph-qt.xiphqt</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1.8</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Xiph QuickTime Components 0.1.8, Copyright © 2005-2007 Arek Korbik</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Vorbis-to-MD</key>
<dict>
<key>ALBUM=</key>
<string>albm</string>
<key>ARTIST=</key>
<string>arts</string>
<key>COMMENT=</key>
<string>cmmt</string>
<key>COPYRIGHT=</key>
<string>cprt</string>
<key>DATE=</key>
<string>©day</string>
<key>DESCRIPTION=</key>
<string>desc</string>
<key>ENCODEDBY=</key>
<string>soft</string>
<key>GENRE=</key>
<string>genr</string>
<key>ORGANIZATION=</key>
<string>prod</string>
<key>PERFORMER=</key>
<string>perf</string>
<key>TITLE=</key>
<string>name</string>
<key>TRANSCODEDFROM=</key>
<string>orif</string>
<key>YEAR=</key>
<string>©day</string>
<key>LICENSE=</key>
<string>info</string>
<key>CONTACT=</key>
<string>info</string>
<key>ISRC=</key>
<string>info</string>
</dict>
<key>Vorbis-to-UD</key>
<dict>
<key>ALBUM=</key>
<string>©alb</string>
<key>ARTIST=</key>
<string>©ART</string>
<key>COMMENT=</key>
<string>©cmt</string>
<key>COPYRIGHT=</key>
<string>©cpy</string>
<key>DATE=</key>
<string>©day</string>
<key>DESCRIPTION=</key>
<string>©des</string>
<key>ENCODEDBY=</key>
<string>©enc</string>
<key>GENRE=</key>
<string>©gen</string>
<key>LICENSE=</key>
<string>©dis</string>
<key>ORGANIZATION=</key>
<string>©prd</string>
<key>PERFORMER=</key>
<string>©prf</string>
<key>TITLE=</key>
<string>©nam</string>
<key>TRACKNUMBER=</key>
<string>©trk</string>
<key>TRANSCODEDFROM=</key>
<string>©fmt</string>
<key>YEAR=</key>
<string>©day</string>
<key>CONTACT=</key>
<string>©inf</string>
<key>ISRC=</key>
<string>©inf</string>
</dict>
<key>other--or--not-used-a_t_m_</key>
<dict>
<key>TRACKNUMBER=</key>
<string>????</string>
<key>LICENSE=</key>
<string>????</string>
<key>CONTACT=</key>
<string>????</string>
<key>ISRC=</key>
<string>????</string>
<key>VERSION=</key>
<string>????</string>
<key>LOCATION=</key>
<string>????</string>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 63 356 240 0 0 1280 832 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOldestOS</key>
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
<integer>166</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>
<key>IBUserGuides</key>
<dict>
<key>166</key>
<dict>
<key>guideLocations</key>
<array>
<string>Vertical:90.000000</string>
</array>
<key>guidesLocked</key>
<false/>
</dict>
</dict>
<key>targetFramework</key>
<string>IBCarbonFramework</string>
</dict>
</plist>
<?xml version="1.0" standalone="yes"?>
<object class="NSIBObjectData">
<string name="targetFramework">IBCarbonFramework</string>
<object name="rootObject" class="NSCustomObject" id="1">
<string name="customClass">NSApplication</string>
</object>
<array count="8" name="allObjects">
<object class="IBCarbonWindow" id="166">
<string name="windowRect">166 334 288 756 </string>
<string name="title">Ogg Exporter Settings</string>
<object name="rootControl" class="IBCarbonRootControl" id="167">
<string name="bounds">0 0 122 422 </string>
<string name="viewFrame">0 0 422 122 </string>
<array count="6" name="subviews">
<object class="IBCarbonButton" id="182">
<string name="bounds">21 90 41 182 </string>
<string name="viewFrame">90 21 92 20 </string>
<ostype name="controlSignature">XiOE</ostype>
<int name="controlID">3</int>
<string name="title">Settings…</string>
<ostype name="command">OEcv</ostype>
<object name="layoutInfo" class="IBCarbonHILayoutInfo">
<int name="bindingLeftKind">1</int>
</object>
</object>
<object class="IBCarbonButton" id="183">
<string name="bounds">53 90 73 182 </string>
<string name="viewFrame">90 53 92 20 </string>
<ostype name="controlSignature">XiOE</ostype>
<int name="controlID">4</int>
<string name="title">Settings…</string>
<ostype name="command">OEca</ostype>
<object name="layoutInfo" class="IBCarbonHILayoutInfo">
<int name="bindingLeftKind">1</int>
</object>
</object>
<object class="IBCarbonButton" id="181">
<string name="bounds">82 252 102 321 </string>
<string name="viewFrame">252 82 69 20 </string>
<int name="controlID">2</int>
<string name="title">Cancel</string>
<ostype name="command">not!</ostype>
<object name="layoutInfo" class="IBCarbonHILayoutInfo">
<int name="bindingBottomKind">2</int>
<int name="bindingRightKind">2</int>
</object>
<int name="buttonType">2</int>
</object>
<object class="IBCarbonButton" id="180">
<string name="bounds">82 333 102 402 </string>
<string name="viewFrame">333 82 69 20 </string>
<int name="controlID">1</int>
<string name="title">OK</string>
<ostype name="command">ok </ostype>
<object name="layoutInfo" class="IBCarbonHILayoutInfo">
<int name="bindingBottomKind">2</int>
<int name="bindingRightKind">2</int>
</object>
<int name="buttonType">1</int>
</object>
<object class="IBCarbonCheckBox" id="184">
<string name="bounds">22 20 40 79 </string>
<string name="viewFrame">20 22 59 18 </string>
<ostype name="controlSignature">XiOE</ostype>
<int name="controlID">5</int>
<string name="title">Video</string>
<ostype name="command">OEev</ostype>
<int name="initialState">1</int>
<boolean name="autoToggle">FALSE</boolean>
</object>
<object class="IBCarbonCheckBox" id="185">
<string name="bounds">54 20 72 79 </string>
<string name="viewFrame">20 54 59 18 </string>
<ostype name="controlSignature">XiOE</ostype>
<int name="controlID">6</int>
<string name="title">Audio</string>
<ostype name="command">OEea</ostype>
<int name="initialState">1</int>
<boolean name="autoToggle">FALSE</boolean>
</object>
</array>
</object>
<boolean name="receiveUpdates">FALSE</boolean>
<boolean name="isResizable">FALSE</boolean>
<boolean name="compositing">TRUE</boolean>
<int name="carbonWindowClass">4</int>
<int name="windowPosition">7</int>
</object>
<reference idRef="167"/>
<reference idRef="180"/>
<reference idRef="181"/>
<reference idRef="182"/>
<reference idRef="183"/>
<reference idRef="184"/>
<reference idRef="185"/>
</array>
<array count="8" name="allParents">
<reference idRef="1"/>
<reference idRef="166"/>
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="167"/>
</array>
<dictionary count="2" name="nameTable">
<string>File&apos;s Owner</string>
<reference idRef="1"/>
<string>Settings</string>
<reference idRef="166"/>
</dictionary>
<unsigned_int name="nextObjectID">186</unsigned_int>
</object>
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
AppName=Skylive-NG
AppVerName=Skylive-NG 0.1.5
AppPublisher=Skylive
AppPublisherURL=http://www.skylive.it/
AppSupportURL=http://www.skylive.it/
AppUpdatesURL=http://www.skylive.it/
DefaultDirName={pf}\Skylive-NG
DefaultGroupName=Skylive-NG
LicenseFile=..\dist\LICENSE.txt
OutputBaseFilename=SkyliveNG-0.1.5_Win32_install
SetupIconFile=..\dist\ICONA.ico
Compression=lzma/ultra
VersionInfoVersion=0.1.5.5
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}";
; Temporaneo
[InstallDelete]
Type: filesandordirs; Name: "{app}\skylive"
Type: files; Name: "{app}\skylive*"
Type: files; Name: "{app}\*rsrc.py"
[Files]
Source: "..\scripts\kill.exe"; DestDir: "{tmp}"; AfterInstall: killProc
Source: "..\scripts\oggcodecs.exe"; DestDir: "{tmp}"; AfterInstall: InstallVorbis
Source: "..\dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\Skylive-NG"; Filename: "{app}\skylive-ng.exe"; WorkingDir: "{app}"; IconFilename: "{app}\ICONA.ico"
Name: "{group}\{cm:ProgramOnTheWeb,Skylive-NG}"; Filename: "http://www.skylive.it/"
Name: "{group}\{cm:UninstallProgram,Skylive-NG}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Skylive-NG"; Filename: "{app}\skylive-ng.exe"; Tasks: desktopicon; WorkingDir: "{app}"; IconFilename: "{app}\ICONA.ico"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Skylive-NG"; Filename: "{app}\skylive-ng.exe"; Tasks: quicklaunchicon; WorkingDir: "{app}"; IconFilename: "{app}\ICONA.ico"
[Run]
Filename: "{app}\README.txt"; Description: "Read README.txt"; Flags: shellexec nowait skipifsilent unchecked
Filename: "{app}\skylive-ng.exe"; Description: "{cm:LaunchProgram,Skylive-NG}"; Flags: nowait postinstall
[Code]
procedure killProc();
var
ReturnCode: Integer;
begin
Exec(ExpandConstant('{tmp}\kill.exe'), 'skylive-ng.exe', '', SW_HIDE, ewWaitUntilTerminated, ReturnCode);
end;
procedure InstallVorbis();
var
ReturnCode: Integer;
begin
Exec(ExpandConstant('{tmp}\oggcodecs.exe'), '/S', '', SW_HIDE, ewWaitUntilTerminated, ReturnCode);
end;
#!/bin/bash
cp -rp /usr/lib/libgst* $1/lib/
cp -rp /usr/lib/gstreamer* $1/lib/
rm $1/lib/gstreamer*/libgstgconfelements.so
cp -rp /usr/lib/libgnomevfs-2.so* $1/lib/
mkdir -p $1/usr/share
cp -rp /usr/share/gstreamer* $1/usr/share/
mkdir -p $1/lib/gnome-vfs-2.0/
cp -rp /usr/lib/gnome-vfs-2.0/modules/ $1/lib/gnome-vfs-2.0/modules/
cp -rp /lib/libnss* $1/lib/
#!/bin/sh
up="NO"
root="NO"
if [ "$UID" = "0" ] ; then
root="SI"
fi
if [ "$1" = "UPGRADE" ] ; then
root="NO"
up="SI"
fi
if [ "$up" = "NO" ] ; then
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo
echo " SkyliveNG V 0.1.4 Installer"
echo
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo
fi
ask_yn()
{
if [ -n "$1" ] ; then
question=$1
if [ -n "$2" ] ; then
def="$2"
else
def="N"
fi
don=""
resp="$def"
while [ x"$don" = x"" ] ; do
read -p "$question ($def) " userinput
if [ x"$userinput" != x"" ] ; then
resp=$userinput
else
resp=$def
fi
case "$resp" in
y|Y|yes|Yes)
ret=0
don="Y"
;;
n|N|no|No)
don="Y"
ret=1
;;
esac
done
return $ret
fi
}
cancel()
{
if [ -n $1 ] ; then
echo "$1"
fi
exit 0
}
if [ "$up" = "NO" ] ; then
question="Do you want to install SkyliveNG client?"
ask_yn "$question" "N" || cancel "Cancelling."
if [ -f LICENSE.txt ] ; then
cat LICENSE.txt | more
question="Do you accept the License?"
ask_yn "$question" "N" || cancel "Cancelling."
fi
fi
if [ "$root" = "SI" ] ; then
skpath="/usr/share/skylive"
if [ -d /usr/bin ] ; then
d="/usr/bin"
else
d="/bin"
fi
else
skpath="$HOME/.SkyLIVE"
fi
if [ -d "${skpath}" ] ; then
if [ "$up" = "NO" ] ; then
echo "The installer has detected another skyliveng installation."
question="Would you like to override the old install?"
ask_yn "$question" "N" || cancel "Cancelling."
fi
rm -rf ${skpath}
if [ "$root" = "SI" ] ; then
rm -f $d/skylive
fi
fi
if [ "$up" = "NO" ] ; then
echo -n "Copying files... "
fi
mkdir -p ${skpath}
cp -r ./* ${skpath}
if [ "$up" = "NO" ] ; then
echo "OK"
fi
if [ "$up" = "NO" ] ; then
echo -n "Fixing permission... "
fi
chmod +x ${skpath}/skylive-ng
if [ "$up" = "NO" ] ; then
echo "OK"
fi
if [ "$up" = "NO" ] ; then
echo -n "Generating launcher wrapper... "
fi
if [ "$root" = "SI" ] ; then
cat > $d/skylive << EOF
#!/bin/sh
if [ -f "\$HOME/.SkyLIVE/skylivengWrap" ] ; then
u="NO"
if [ -f "\$HOME/.SkyLIVE/VERSION.txt" ] ; then
if [ -f "/usr/share/skylive/VERSION.txt" ] ; then
rv=\$(cat /usr/share/skylive/VERSION.txt)
uv=\$(cat "\$HOME/.SkyLIVE/VERSION.txt")
if [ "\$uv" -gt "\$rv" ] ; then
u="OK"
fi
else
u="OK"
fi
fi
else
u="NO"
fi
if [ "\$u" = "OK" ] ; then
. \$HOME/.SkyLIVE/skylivengWrap
else
if [ ! -h "\$HOME/Desktop/skyliveng.desktop" ] ; then
ln -s /usr/share/skylive/skyliveng.desktop \$HOME/Desktop/skyliveng.desktop
fi
SKYPATH=/usr/share/skylive
SKYLINKER=\$SKYPATH/lib/ld-linux.so.2
cd "\$SKYPATH"
export GSTREAMER_PLUGIN_SYSTEM_PATH="\$SKYPATH/lib/gstreamer-0.10"
export GST_PLUGIN_SYSTEM_PATH="\${GSTREAMER_PLUGIN_SYSTEM_PATH}"
export GNOME_VFS_MODULE_PATH="\$SKYPATH/lib/gnome-vfs-2.0/modules/"
LD_LIBRARY_PATH=\$SKYPATH:\$SKYPATH/lib \$SKYLINKER ./skylive-ng \$@ >/dev/null 2>&1
fi
EOF
chmod +x $d/skylive
else
cat > ${skpath}/skylivengWrap << EOF
#!/bin/sh
SKYPATH=${skpath}
SKYLINKER=\$SKYPATH/lib/ld-linux.so.2
cd "\$SKYPATH"
export GSTREAMER_PLUGIN_SYSTEM_PATH="\$SKYPATH/lib/gstreamer-0.10"
export GST_PLUGIN_SYSTEM_PATH="\${GSTREAMER_PLUGIN_SYSTEM_PATH}"
export GNOME_VFS_MODULE_PATH="\$SKYPATH/lib/gnome-vfs-2.0/modules/"
LD_LIBRARY_PATH=\$SKYPATH:\$SKYPATH/lib \$SKYLINKER ./skylive-ng \$@ >/dev/null 2>&1
EOF
chmod +x ${skpath}/skylivengWrap
fi
if [ "$up" = "NO" ] ; then
echo "OK"
fi
if [ "$up" = "NO" ] ; then
echo -n "Trying to install .desktop file..."
fi
desk="NO"
if [ "$root" = "SI" ] ; then
if [ -d "/usr/share/applications" ] ; then
rm -f /usr/share/applications/skyliveng.desktop
ln -s /usr/share/skylive/skyliveng.desktop /usr/share/applications/skyliveng.desktop
desk="SI"
fi
else
cat > ${skpath}/skyliveng.desktop << EOF
[Desktop Entry]
Name=SkyLiveNG
Exec=${skpath}/skylivengWrap
Icon=${skpath}/ICONA.ico
Categories=Science;Astronomy;Education;
EOF
if [ -d $HOME/Desktop/ ] ; then
rm -f $HOME/Desktop/skyliveng.desktop
ln -s ${skpath}/skyliveng.desktop $HOME/Desktop/skyliveng.desktop
desk="SI"
fi
if [ "$desk" != "SI" ] ; then
xdg=`which xdg-desktop-icon`
if [ x"$xdg" != x"" ] ; then
xdg-desktop-icon install --novendor ${skpath}/skyliveng.desktop
desk="SI"
fi
fi
fi
if [ "$up" = "NO" ] ; then
if [ "$desk" = "SI" ] ; then
echo "OK"
else
echo "No. I can't."
fi
fi
if [ "$up" = "NO" ] ; then
echo -n "Trying to install menu entry..."
fi
me="NO"
if [ "$root" = "SI" ] ; then
xdg=`which xdg-desktop-menu`
if [ x"$xdg" != x"" ] ; then
export XDG_UTILS_INSTALL_MODE="system"
xdg-desktop-menu install --novendor --mode system ${skpath}/skylive-science.directory ${skpath}/skyliveng.desktop
me="SI"
fi
else
xdg=`which xdg-desktop-menu`
if [ x"$xdg" != x"" ] ; then
export XDG_UTILS_INSTALL_MODE="user"
xdg-desktop-menu install --novendor --mode user ${skpath}/skylive-science.directory ${skpath}/skyliveng.desktop
me="SI"
fi
fi
if [ "$up" = "NO" ] ; then
if [ "$me" = "SI" ] ; then
echo "OK"
else
echo "No. I can't."
fi
fi
if [ "$up" = "NO" ] ; then
echo -n "Cleaning installer..."
fi
rm -f ${skpath}/linux_install.sh
if [ "$up" = "NO" ] ; then
echo "OK"
echo
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo " "
if [ "$root" = "SI" ] ; then
echo " Installation finished. Launch \"$d/skylive\" to run the client. "
else
echo " Installation finished. Launch \"${skpath}/skylivengWrap\" to run the client "
fi
echo " For more informations, look at the \"$skpath/README.txt\" file. "
echo " "
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo
else
setsid ${skpath}/skylivengWrap
fi
#!/bin/sh
base=$(dirname ${0})
cp ${base}/osx_upgrade.sh ${base}/../dist/UPGRADE.sh
#mv ${base}/../dist/skylive-ng.app/Contents/MacOS/skylive-ng ${base}/../dist/skylive-ng.app/Contents/MacOS/skylive-ng.bin
#cp ${base}/osx_wrapper.sh ${base}/../dist/skylive-ng.app/Contents/MacOS/skylive-ng
cp ${base}/../src/VERSION.txt ${base}/../dist/skylive-ng.app/Contents/MacOS/VERSION.txt
cp -R ${base}/XiphQT.component ${base}/../dist/skylive-ng.app/
#!/bin/bash
cd /
sleep 5
volname=${1}
base=${volname}
echo "start ${base}, ${HOME}" > /tmp/SkyliveUpgrade.log
if [ -f "${HOME}/.SkyLIVE.app" ] ; then
echo "Removing Old client" >> /tmp/SkyliveUpgrade.log
rm -rf "${HOME}/.SkyLIVE.app" >> /tmp/SkyliveUpgrade.log 2>&1
fi
cp -r ${base}/skylive-ng.app "${HOME}/.SkyLIVE.app" >> /tmp/SkyliveUpgrade.log 2>&1
#mv "${HOME}/.SkyLIVE.app/Contents/MacOS/skylive-ng.bin" "${HOME}/.SkyLIVE.app/Contents/MacOS/skylive-ng" >> /tmp/SkyliveUpgrade.log 2>&1
hdiutil detach ${volname} >> /tmp/SkyliveUpgrade.log 2>&1
${HOME}/.SkyLIVE.app/Contents/MacOS/skylive-ng &
echo "Launched" >> /tmp/SkyliveUpgrade.log
disown %1
#!/bin/bash
u="NO"
ME=$(dirname ${0})
if [ -f "${HOME}/.SkyLIVE.app/Contents/MacOS/skylive-ng" ] ; then
if [ -f "${HOME}/.SkyLIVE.app/Contents/MacOS/VERSION.txt" ] ; then
if [ -f "${ME}/VERSION.txt" ] ; then
rv=$(cat "${ME}/VERSION.txt")
uv=$(cat "${HOME}/.SkyLIVE.app/Contents/MacOS/VERSION.txt")
if [ "$uv" -gt "$rv" ] ; then
u="OK"
fi
else
u="OK"
fi
fi
fi
if [ "$u" = "OK" ] ; then
${HOME}/.SkyLIVE/Contents/MacOS/skylive-ng $@ &
disown %1
else
${ME}/skylive-ng.bin $@ &
disown %1
fi
This diff is collapsed.
"""
Copyright (C) 2007,2008 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007,2008 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007,2008 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
print 'DON\'T WORK FOR NOW!!!'
print 'USE build.py OR MANUAL INSTALL!'
import sys
sys.exit(0)
File added
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable/>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
/>
<file name="msvcr90.dll" /> <file name="msvcp90.dll" /> <file name="msvcm90.dll" />
</assembly>
____ _ _ _ _ _ ____
/ ___|| | ___ _| (_)_ _____ | \ | |/ ___|
\___ \| |/ / | | | | \ \ / / _ \_____| \| | | _
___) | <| |_| | | |\ V / __/_____| |\ | |_| |
|____/|_|\_\\__, |_|_| \_/ \___| |_| \_|\____|
|___/ Version 0.1.4
--------------------------------------------------
I really shuld write something here...
"""
Copyright (C) 2007 Franco Lanza <nextime@nexlab.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
"""
__version__ = "$Revision:$"
__date__ = "$Date:$"
"""
import wx
from Pycard import event, widget, model
class ContainerSpec( widget.WidgetSpec ) :
def __init__( self ) :
events = [ event.MouseClickEvent ]
attributes = {}
widget.WidgetSpec.__init__( self, 'Container', 'Widget', events, attributes )
class Container( widget.Widget, model.Scriptable, wx.Panel ) :
"""
A container panel for composite components.
"""
_spec = ContainerSpec()
def __init__( self, aParent, aResource ) :
model.Scriptable.__init__( self, aParent )
wx.Panel.__init__(
self, aParent, widget.makeNewId(aResource.id),
aResource.position,
aResource.size,
style = wx.CLIP_SIBLINGS,
name = aResource.name
)
widget.Widget.__init__( self, aParent, aResource )
import sys
from Pycard import registry
registry.Registry.getInstance().register(sys.modules[__name__].Container)
"""
__version__ = "$Revision: 1.24 $"
__date__ = "$Date: 2004/08/11 01:58:03 $"
"""
import wx
from Pycard import event, graphic, widget
USE_GENERIC = wx.Platform == '__WXGTK__' or wx.Platform == '__WXMSW__'
if USE_GENERIC:
from wx.lib.statbmp import GenStaticBitmap as StaticBitmap
else:
StaticBitmap = wx.StaticBitmap
class ImageSpec(widget.WidgetSpec):
def __init__(self):
events = []
attributes = {
'file' : { 'presence' : 'optional', 'default':'' },
# KEA shouldn't there be a 'file' attribute here
# could call it 'image' to match background above
# but it is mandatory
#'bitmap' : { 'presence' : 'optional', 'default' : None },
# KEA kill border for now, until variations of what is possible are worked out
# use ImageButton if you want images with transparent border
#'border' : { 'presence' : 'optional', 'default' : '3d', 'values' : [ '3d', 'transparent', 'none' ] },
'size' : { 'presence' : 'optional', 'default' : [ -1, -1 ] },
}
widget.WidgetSpec.__init__( self, 'Image', 'Widget', events, attributes )
class Image(widget.Widget, StaticBitmap):
"""
A static image.
"""
_spec = ImageSpec()
def __init__(self, aParent, aResource):
self._bitmap = graphic.Bitmap(aResource.file, aResource.size)
self._file = aResource.file
self._size = tuple(aResource.size)
w = aResource.size[0]
if w == -2:
w = self._bitmap.getWidth()
h = aResource.size[1]
if h == -2:
h = self._bitmap.getHeight()
size = (w, h)
#size = wx.Size( self._bitmap.GetWidth(), self._bitmap.GetHeight() )
##if aResource.border == 'transparent':
## mask = wx.MaskColour(self._bitmap, wxBLACK)
## self._bitmap.SetMask(mask)
StaticBitmap.__init__(
self,
aParent,
widget.makeNewId(aResource.id),
self._bitmap.getBits(),
aResource.position,
size,
style = wx.NO_FULL_REPAINT_ON_RESIZE | wx.CLIP_SIBLINGS,
name = aResource.name
)
widget.Widget.__init__( self, aParent, aResource )
wx.EVT_WINDOW_DESTROY(self, self._OnDestroy)
# Try to remove flickering on windows.
#wx.EVT_ERASE_BACKGROUND( self, lambda evt: None)
self._bindEvents(event.WIDGET_EVENTS)
def _OnDestroy(self, event):
# memory leak cleanup
self._bitmap = None
event.Skip()
# KEA added getBitmap, setBitmap
def _getBitmap( self ) :
return self._bitmap
def _setBitmap( self, aValue ) :
self._bitmap = aValue
self.SetBitmap( aValue.getBits() )
# may actually need to refresh the panel as well
# depending on the size of the new bitmap compared
# to the old one
# in addition, the size of the image or imagebutton needs
# to be set appropriately after changing the bitmap so
# there are still a few issues to work out
self.Refresh()
"""
# KEA do we query the Bitmap to find the actual dimensions
# _size can contain -1, and -2
# or provide a special getBitmapSize method?
# this getSize is actually the same as its parent
def _getSize( self ) :
return self.GetSizeTuple() # get the actual size, not (-1, -1)
"""
# KEA special handling for -2 size option
def _setSize(self, aSize):
self._size = tuple(aSize)
w = aSize[0]
if w == -2:
w = self._bitmap.getWidth()
h = aSize[1]
if h == -2:
h = self._bitmap.getHeight()
self.SetSize((w, h))
# KEA 2001-08-02
# right now the image is loaded from a filename
# during initialization
# but later these might not make any sense
# if setBitmap is used directly in user code
def _getFile( self ) :
return self._file
# KEA 2001-08-14
# if we're going to support setting the file
# after initialization, then this will need to handle the bitmap loading
# overhead
def _setFile( self, aFile ) :
self._file = aFile
self._setBitmap(graphic.Bitmap(aFile))
def _setBackgroundColor( self, aColor ) :
aColor = self._getDefaultColor( aColor )
if self._file == '':
bmp = self._bitmap.getBits()
dc = wx.MemoryDC()
dc.SelectObject(bmp)
dc.SetBackground(wx.Brush(aColor))
dc.Clear()
dc.SelectObject(wx.NullBitmap)
self.SetBackgroundColour( aColor )
self.Refresh() # KEA wxPython bug?
backgroundColor = property(widget.Widget._getBackgroundColor, _setBackgroundColor)
bitmap = property(_getBitmap, _setBitmap)
file = property(_getFile, _setFile)
size = property(widget.Widget._getSize, _setSize)
import sys
from Pycard import registry
registry.Registry.getInstance().register(sys.modules[__name__].Image)
"""
__version__ = "$Revision: 1.17 $"
__date__ = "$Date: 2004/05/13 02:40:24 $"
"""
import wx
from wx import html
from Pycard import event, log, widget
import webbrowser
class InfoHtmlWindowSpec(widget.WidgetSpec):
def __init__(self):
events = []
attributes = {
'size' : { 'presence' : 'optional', 'default' : [ 50, 50 ] },
'text' : { 'presence' : 'optional', 'default' : '' },
}
widget.WidgetSpec.__init__(self, 'InfoHtmlWindow', 'Widget', events, attributes )
class InfoHtmlWindow(widget.Widget, html.HtmlWindow):
"""
An HTML window.
"""
_spec = InfoHtmlWindowSpec()
def __init__(self, aParent, aResource):
self._addressField = None
html.HtmlWindow.__init__(
self,
aParent,
widget.makeNewId(aResource.id),
aResource.position,
aResource.size,
#style = wx.HW_SCROLLBAR_AUTO | wx.CLIP_SIBLINGS,
name = aResource.name
)
widget.Widget.__init__(self, aParent, aResource)
self._setText(aResource.text)
self._bindEvents(event.WIDGET_EVENTS)
def setAddressField(self, field):
self._addressField = field
def _getText(self) :
return self.GetOpenedPage()
def _setText(self, aString):
if aString == '' or aString[0] == '<':
self.SetPage(aString)
else:
# filename
self.LoadPage(aString)
#self._delegate.Refresh()
def base_LoadPage(self, url):
log.debug("base_LoadPage " + url)
if self._addressField is not None:
self._addressField.text = url
log.debug("loaded")
html.HtmlWindow.base_LoadPage(self, url)
def LoadPage(self, url):
log.debug("LoadPage " + url)
if self._addressField is not None:
self._addressField.text = url
log.debug("loaded")
html.HtmlWindow.LoadPage(self, url)
def SetPage(self, text):
log.debug("SetPage " + text)
#if self._addressField is not None:
# self._addressField.text = text
# log.debug("set")
html.HtmlWindow.SetPage(self, text)
def OnLinkClicked(self, link):
log.debug("OnLinkClicked " + str(link))
webbrowser.open(str(link.GetHref()))
text = property(_getText, _setText)
import sys
from Pycard import registry
registry.Registry.getInstance().register(sys.modules[__name__].InfoHtmlWindow)
"""
Copyright (C) 2007 Franco Lanza <nextime@nexlab.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
import wx
from Pycard import event, graphic, widget
USE_GENERIC = wx.Platform == '__WXGTK__'
if USE_GENERIC:
from wx.lib.statbmp import GenStaticBitmap as StaticBitmap
else:
StaticBitmap = wx.StaticBitmap
ScrolledWindow = wx.ScrolledWindow
class ScrolledImageSpec(widget.WidgetSpec):
def __init__(self):
events = []
attributes = {
'file' : { 'presence' : 'optional', 'default':'' },
'size' : { 'presence' : 'optional', 'default' : [ -1, -1 ] },
}
widget.WidgetSpec.__init__( self, 'Image', 'Widget', events, attributes )
class ScrolledImage(widget.Widget, StaticBitmap):
"""
A static image.
"""
_spec = ScrolledImageSpec()
def __init__(self, aParent, aResource):
self._bitmap = graphic.Bitmap(aResource.file, aResource.size)
self._file = aResource.file
self._size = tuple(aResource.size)
w = aResource.size[0]
if w == -2:
w = self._bitmap.getWidth()
h = aResource.size[1]
if h == -2:
h = self._bitmap.getHeight()
size = (w, h)
#size = wx.Size( self._bitmap.GetWidth(), self._bitmap.GetHeight() )
##if aResource.border == 'transparent':
## mask = wx.MaskColour(self._bitmap, wxBLACK)
## self._bitmap.SetMask(mask)
self.sw = ScrolledWindow(self)
StaticBitmap.__init__(self.sw, aParent, widget.makeNewId(aResource.id), self._bitmap.getBits(),
aResource.position, size, style = wx.NO_FULL_REPAINT_ON_RESIZE | wx.CLIP_SIBLINGS,
name = aResource.name )
widget.Widget.__init__( self, aParent, aResource )
wx.EVT_WINDOW_DESTROY(self, self._OnDestroy)
self._bindEvents(event.WIDGET_EVENTS)
def _OnDestroy(self, event):
# memory leak cleanup
self._bitmap = None
event.Skip()
# KEA added getBitmap, setBitmap
def _getBitmap( self ) :
return self._bitmap
def _setBitmap( self, aValue ) :
self._bitmap = aValue
self.SetBitmap( aValue.getBits() )
# may actually need to refresh the panel as well
# depending on the size of the new bitmap compared
# to the old one
# in addition, the size of the image or imagebutton needs
# to be set appropriately after changing the bitmap so
# there are still a few issues to work out
self.Refresh()
"""
# KEA do we query the Bitmap to find the actual dimensions
# _size can contain -1, and -2
# or provide a special getBitmapSize method?
# this getSize is actually the same as its parent
def _getSize( self ) :
return self.GetSizeTuple() # get the actual size, not (-1, -1)
"""
# KEA special handling for -2 size option
def _setSize(self, aSize):
self._size = tuple(aSize)
w = aSize[0]
if w == -2:
w = self._bitmap.getWidth()
h = aSize[1]
if h == -2:
h = self._bitmap.getHeight()
self.SetSize((w, h))
# KEA 2001-08-02
# right now the image is loaded from a filename
# during initialization
# but later these might not make any sense
# if setBitmap is used directly in user code
def _getFile( self ) :
return self._file
# KEA 2001-08-14
# if we're going to support setting the file
# after initialization, then this will need to handle the bitmap loading
# overhead
def _setFile( self, aFile ) :
self._file = aFile
self._setBitmap(graphic.Bitmap(aFile))
def _setBackgroundColor( self, aColor ) :
aColor = self._getDefaultColor( aColor )
if self._file == '':
bmp = self._bitmap.getBits()
dc = wx.MemoryDC()
dc.SelectObject(bmp)
dc.SetBackground(wx.Brush(aColor))
dc.Clear()
dc.SelectObject(wx.NullBitmap)
self.SetBackgroundColour( aColor )
self.Refresh() # KEA wxPython bug?
backgroundColor = property(widget.Widget._getBackgroundColor, _setBackgroundColor)
bitmap = property(_getBitmap, _setBitmap)
file = property(_getFile, _setFile)
size = property(widget.Widget._getSize, _setSize)
import sys
from Pycard import registry
registry.Registry.getInstance().register(sys.modules[__name__].ScrolledImage)
"""
__version__ = "$Revision: 1.29 $"
__date__ = "$Date: 2005/12/25 13:44:50 $"
"""
import wx
from Pycard import event, widget
from Pycard.components import list as orlist
ContainerMixin = orlist.ContainerMixin
ListSelectEvent = orlist.ListSelectEvent
ListMouseDoubleClickEvent = orlist.ListMouseDoubleClickEvent
class UListSpec(widget.WidgetSpec):
def __init__(self):
events = list(orlist.ListEvents)
attributes = {
'items' : { 'presence' : 'optional', 'default' : [] },
'stringSelection' : { 'presence' : 'optional', 'default' : None }
}
widget.WidgetSpec.__init__( self, 'UList', 'Widget', events, attributes )
self._events.remove(event.MouseDoubleClickEvent)
class UList(orlist.List):
"""
A list that only allows a single item to be selected.
"""
_spec = UListSpec()
def __init__(self, aParent, aResource):
wx.ListBox.__init__(
self,
aParent,
widget.makeNewId(aResource.id),
aResource.position,
aResource.size,
aResource.items,
style = wx.LB_SINGLE | wx.LB_ALWAYS_SB | wx.NO_FULL_REPAINT_ON_RESIZE | wx.CLIP_SIBLINGS,
name = aResource.name
)
widget.Widget.__init__(self, aParent, aResource)
if aResource.stringSelection:
self._setStringSelection(aResource.stringSelection)
self._bindEvents(self._spec._events)
import sys
from Pycard import registry
registry.Registry.getInstance().register(sys.modules[__name__].UList)
#!/usr/bin/env python
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
"""
__version__ = "$Revision: 0.1 $"
__date__ = "$Date: 2007/09/25 22:13:23 $"
"""
from gui import fitsopener
if __name__ == "__main__":
fitsopener.run()
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
from Pycard import model, dialog
from skylive import config
import wx
class AskStream(model.Background):
def on_initialize(self, event):
self.parent = self.getParent()
def on_close(self, event):
self.parent.on_CloseAskStream(event)
event.skip()
def on_exit_command(self, event):
self.close()
def on_size(self, event):
self.panel.SetSize(self.size)
def on_ButtonYes_mouseClick(self, event):
self.parent.on_realStartStream(event)
def on_ButtonNo_mouseClick(self, event):
self.parent.on_realNoStream(event)
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgFocus',
'title':u'AudioVideo',
'size':(285, 126),
'components': [
{'type':'StaticText',
'name':'ask',
'position':(15, 5),
'backgroundColor':(238, 238, 236, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
'text':'Do you want to listen our audio stream?',
},
{'type':'CheckBox',
'name':'save',
'position':(97, 47),
'backgroundColor':(238, 238, 236, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
'label':"don't ask anymore",
'checked': True,
},
{'type':'Button',
'name':'ButtonNo',
'position':(142, 19),
'size':(32, -1),
'backgroundColor':(238, 238, 236, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
'label':'No',
},
{'type':'Button',
'name':'ButtonYes',
'position':(97, 18),
'size':(32, -1),
'backgroundColor':(238, 238, 236, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
'label':'Yes',
},
] # end components
,
'sizers':
[
{
'name' : 'ALL',
'typ' : 'i',
'children' : [
{
'name' : 'TOP SIZER',
'typ' : 'v',
'horGrowth' : 1,
'verGrowth' : 1,
'children' : [
{
'name' : 'versizer001',
'typ' : 'v',
'children' : [
{
'name' : 'ask' },
{
'name' : 'horsizer000',
'typ' : 'h',
'children' : [
{
'name' : 'ButtonYes' },
{
'name' : 'ButtonNo' },
] # end of horsizer000
},
{
'name' : 'save' },
] # end of versizer001
},
] # end of TOP SIZER
},
{
'name' : 'UNPLACED',
'typ' : 'i' },
] # end of ALL
},
] # end of sizers
} # end background
] # end backgrounds
} }
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
from Pycard import model
class Booking(model.Background):
def on_initialize(self, event):
pass
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':'Standard Template with File->Exit menu',
'size':(441, 289),
'style':['resizeable'],
'menubar': {'type':'MenuBar',
'menus': [
{'type':'Menu',
'name':'menuFile',
'label':'&File',
'items': [
{'type':'MenuItem',
'name':'menuFileExit',
'label':'E&xit',
'command':'exit',
},
]
},
]
},
'components': [
{'type':'ToggleButton',
'name':'ToggleButton111111111',
'position':(361, 150),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton111111111',
},
{'type':'ToggleButton',
'name':'ToggleButton11111111',
'position':(361, 132),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton11111111',
},
{'type':'ToggleButton',
'name':'ToggleButton1111111',
'position':(361, 114),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton1111111',
},
{'type':'ToggleButton',
'name':'ToggleButton111111',
'position':(361, 95),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton111111',
},
{'type':'ToggleButton',
'name':'ToggleButton11111',
'position':(361, 77),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton11111',
},
{'type':'ToggleButton',
'name':'ToggleButton1111',
'position':(361, 58),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton1111',
},
{'type':'ToggleButton',
'name':'ToggleButton111',
'position':(361, 39),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton111',
},
{'type':'ToggleButton',
'name':'ToggleButton11',
'position':(361, 20),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
'label':'ToggleButton11',
},
{'type':'ToggleButton',
'name':'ToggleButton1',
'position':(361, 2),
'size':(25, 19),
'backgroundColor':(255, 0, 0, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(255, 0, 0, 255),
},
{'type':'Calendar',
'name':'Calendar1',
'position':(36, 102),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
},
] # end components
,
'sizers':
[
{
'name' : 'ALL',
'typ' : 'i',
'children' : [
{
'name' : 'TOP SIZER',
'typ' : 'v',
'horGrowth' : 1,
'verGrowth' : 1 },
{
'name' : 'UNPLACED',
'typ' : 'i',
'children' : [
{
'name' : 'Calendar1' },
{
'name' : 'ToggleButton1' },
{
'name' : 'ToggleButton11' },
{
'name' : 'ToggleButton111' },
{
'name' : 'ToggleButton1111' },
{
'name' : 'ToggleButton11111' },
{
'name' : 'ToggleButton111111' },
{
'name' : 'ToggleButton1111111' },
{
'name' : 'ToggleButton11111111' },
{
'name' : 'ToggleButton111111111' },
] # end of UNPLACED
},
] # end of ALL
},
] # end of sizers
} # end background
] # end backgrounds
} }
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
from Pycard import model, dialog, timer
import os, wx, webbrowser
from skylive import config
from skylive.utils import genutils
import time
from skylive import chatparser as parser
class ChatPrivate(model.Background):
chathtml = []
latest = ''
def on_initialize(self, event):
self.parent = self.getParent()
if self.parent.lang == "it":
self.blinkMsg = "Nuovo messaggio"
else:
self.blinkMsg = "New message"
self.deactiv = False
self.canSelect = False
self.canbeep, self.canpopup = config.get_pvtPref()
self.components.ChatMsg.setFocus()
if genutils.platform() == 'Darwin':
self.blinkTimer = timer.Timer(self.components.ChatArea, -1)
self.origTitle = self.title
self.iconOn = True
self.last_idle = time.time()
self.SetSizeHints(200, 200)
self.resizeAll()
def on_close(self, event):
self.parent.on_PrivChatClose(self.touser)
event.skip()
def on_exit_command(self, event):
self.close()
def on_menuSavePrivChat_select(self, event):
#self.chatPrivText = self.components.ChatArea.text
self.chatPrivText = self.components.ChatArea.text
self.chat_file_path = os.path.expanduser("~")
self.chat_file_save_path = os.path.normpath(self.chat_file_path+"/skylive-ng_chat")
self.usr_file_name = self.tousercomp+".txt"
result = dialog.saveFileDialog(self, "Save Text file as:", self.chat_file_save_path, self.usr_file_name, 'Text Files: (*.txt)|*.txt')
if result.accepted:
self.path = result.paths[0]
self.chat_file = open(self.path,"w")
self.chat_file.write("Start private chat text whit "+self.tousercomp+"\n"+self.chatPrivText)
self.chat_file.close()
dialog.alertDialog(self, "Private chat text saved in "+self.path)
def on_Send_mouseClick(self, event):
txt = self.components.ChatMsg.text
self.components.ChatMsg.text = ''
if len(txt.replace(" ", "")) > 0:
#self.components.ChatArea.appendText("<"+self.parent.config.getUsername()+"> "+txt+"\n")
self.parent.addToPrivChatWindow(self.parent.config.getUsername(), parser.toHtml(txt), str(self.touser), 'red')
#self.parent.callInTwisted('sendNetworkData', self.parent.srvproto.chatSendPrivate(self.tousercomp, txt))
self.parent.TwistedLoop.sendNetworkData(self.parent.srvproto.chatSendPrivate(self.tousercomp, txt))
def on_ChatMsg_keyPress(self, event):
if event.GetKeyCode() == wx.WXK_RETURN:
self.on_Send_mouseClick(event)
event.skip()
else:
event.skip()
def on_ChatArea_gainFocus(self, event):
# Ugly, bad, orrible hack to make
# the fucking windows work with RETURN keypress.
if not self.canSelect:
if os.name == 'nt':
if len(self.components.ChatMsg.text) > 0:
self.on_Send_mouseClick(False)
event.skip()
self.components.ChatMsg.setFocus()
def on_deactivate(self, event):
self.deactiv = True
def on_activate(self, event):
self.deactiv = False
#self.components.ChatMsg.setFocus()
if genutils.platform() == 'Darwin':
self.blinkTimer.Stop()
self.title = self.origTitle
def on_ChatArea_textUpdate(self, event):
print 'PrivChatArea Updated'
if self.canbeep and self.deactiv:
print '\a'
if self.canpopup and self.deactiv:
self.Restore()
if True and self.deactiv:
if genutils.platform() == 'Darwin':
self.blinkTimer.Start(1000)
else:
self.RequestUserAttention()
def on_ChatArea_mouseDown(self, event):
self.canSelect = True
event.skip()
def on_ChatArea_mouseUp(self, event):
self.canSelect = False
event.skip()
#def on_ChatArea_mouseDoubleClick(self, event):
# x = ''
# y = ''
# url = False
# posA = 0
# posB = 0
# noUrl = False
# cpoint = self.components.ChatArea.getSelection()
# while 'http' not in x and '>' not in x:
# x = self.components.ChatArea.getString(cpoint[0]-posA, cpoint[0]-posA+4)
# if '>' in x or '<' in x:
# noUrl = True
# posA+=1
# if not noUrl:
# while y != ' ' and y != '\n':
# y = self.components.ChatArea.getString(cpoint[1]+posB, cpoint[1]+posB+1)
# posB+=1
# A = cpoint[0]-posA+1
# B = cpoint[1]+posB-1
# text = self.components.ChatArea.getString(A, B)
# if len(text.split(' ')) > 1:
# urlTry = text.split(' ')[0]
# else:
# urlTry = text
# if len(urlTry) > 12:
# url = urlTry
# try:
# if url:
# webbrowser.open(url)
# except:
# self.dialog.alertdialog(self, "Default WebBrowser is not defined")
def on_ChatArea_keyPress(self, event):
key = event.GetKeyCode()
if key in range (31, 128):
self.components.ChatMsg.setFocus()
self.components.ChatMsg.appendText(unicode(chr(key)))
else:
self.components.ChatMsg.setFocus()
event.skip()
def on_ChatArea_timer(self, event):
if self.iconOn:
self.title = self.blinkMsg
self.iconOn = False
else:
self.iconOn = True
self.title = self.origTitle
event.skip()
def on_size(self, event):
w, h = self.size
if w >= 200 and h >= 200:
self.resizeAll()
def resizeAll(self):
winW, winH = self.size
areaW=winW-26
areaH=winH-97
self.components.ChatArea.size = (areaW, areaH)
inputW = areaW-78
inputH = 27
self.components.ChatMsg.size = (inputW, inputH)
self.components.ChatMsg.position = (10, areaH+13)
self.components.Send.position = (inputW+15, areaH+15)
self.panel.SetSize(self.size)
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u'Standard Template with File->Exit menu',
'style': ['resizeable'],
'size':(325, 363),
'icon':'./gui/img/ICONA.ico',
'backgroundColor':(192, 192, 192),
'useSizers':0,
'menubar': {'type':'MenuBar',
'menus': [
{'type':'Menu',
'name':'menuFile',
'label':'&File',
'items': [
{'type':'MenuItem',
'name':'menuSavePrivChat',
'label':'S&ave chat',
},
{'type':'MenuItem',
'name':'menuFileExit',
'label':'E&xit',
'command':'exit',
},
]
},
]
},
'components': [
{'type':'Button',
'name':'Send',
'position':(235, 281),
'size':(73, -1),
'label':'Send',
},
{'type':'TextField',
'name':'ChatMsg',
'position':(10, 279),
#'size':(220, 27),
'size':(-1, -1),
},
#{'type':'TextArea',
# 'name':'ChatArea',
# 'position':(10, 10),
# #'size':(298, 266),
# 'size':(-1, -1),
# 'backgroundColor':(135, 232, 201),
# 'editable':False
# },
{'type':'InfoHtmlWindow',
'name':'ChatArea',
'position':(10, 10),
'size':(-1, -1),
'backgroundColor':(135, 232, 201),
'horGrowth':1,
'userdata':'<html></html>',
'verGrowth':1,
},
] # end components
} # end background
] # end backgrounds
} }
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
from Pycard import model, timer
class DownProgr(model.Background):
def on_initialize(self, event):
self.parent = self.getParent()
def on_close(self, event):
event.skip()
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'DownProgr',
'title':u'Download',
'icon':'gui/img/ICONA.ico',
'size':(310, 120),
'backgroundColor':(192, 192, 192),
'components': [
{'type':'StaticBox',
'name':'downBox',
'position':(5, 5),
'size':(300, 105),
'label':'Download Progress',
},
{'type':'StaticText',
'name':'downpr',
'position':(15, 75),
'size':(250, 30),
'text':'Progress:',
},
{'type':'StaticText',
'name':'progPerc',
'position':(270, 43),
'size':(50, 25),
'text':'0%',
},
{'type':'Gauge',
'name':'progBar',
'position':(15, 40),
'size':(250, 25),
'max':100,
'value':0,
},
] # end components
} # end background
] # end backgrounds
} }
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
from Pycard import model, dialog, graphic
from Pycard.twistedsupport import twistedModel
from twisted.internet import reactor
import Image, ImageOps, numpy
import wx, os, platform
import imageadj
from skylive.utils import genutils as utils
from skylive.lang import language
from skylive.fits import fitsimage, levels
class FitsOpener(model.Background,):
def on_initialize(self, event):
try:
self._parent = self.getParent()
self.userhome = self._parent.usrDefSavePath
self.lang = self._parent.lang
except:
self.lang = 'en'
self.userhome = os.path.expanduser("~")
self.gui = 'imager'
self.ItemText = language.getItemText
def on_open_command(self, event):
try:
if self._parent.lastPath and os.path.exists(self._parent.lastPath):
lpath = self._parent.lastPath
else:
lpath = self.userhome
except:
lpath = self.userhome
selectFits = dialog.fileDialog(self, "Select Image:", lpath, ' ', 'FITS Image: (*.fit)|*.fit')
if selectFits.accepted:
self.fitsFile = selectFits.paths[0]
try:
self._parent.lastPath = os.path.split(self.fitsFile)[0]
except:
pass
self.loadFits(self.fitsFile)
def on_exit_command(self, event):
self.close()
def on_adjust_command(self, event=False):
sysType = platform.system()
if not os.path.exists(os.path.normpath("./gui/imageadj."+sysType+".rsrc.py")):
sysType = "Linux"
self.adjustImg = model.childWindow(self, imageadj.imageAdj, "./gui/imageadj."+sysType+".rsrc.py")
try:
self.adjustImg._parent = self
except:
pass
self.adjustImg.visible = True
try:
self.adjustImg._parent.origImage = [self.pilImage, self.xsizeBit, self.ysizeBit, self.min, self.max, self.med, self.img2, self.ToResize ]
except:
pass
def loadFits(self, fitsFile):
fitsfile = fitsimage.FitsImage(fitsFile, False)
scidata = fitsfile.image
self.autoMax = fitsfile.autoMaxLevel
self.autoMin = fitsfile.autoMinLevel
self.ToResize = fitsfile.pilResized
self.min = fitsfile.min
self.max = fitsfile.max
self.med = fitsfile.med
self.pilImage = fitsfile.pilOrI
self.img = fitsfile.pilImage
self.img2 = fitsfile.pilRaw
self.xsizeBit = fitsfile.xsizeBit
self.ysizeBit = fitsfile.ysizeBit
image = wx.EmptyImage(fitsfile.xsizeBit, fitsfile.ysizeBit)
image.SetData(fitsfile.pilImage.convert("RGB").tostring())
self.imageBitmap = graphic.Bitmap()
self.imageBitmap.setImageBits(image)
self.components.ImageShow.bitmap = self.imageBitmap
self.size = (fitsfile.xsizeBit+20, fitsfile.ysizeBit+100)
try:
self.MenuBar.setEnabled('menuPhoto', True)
except:
self.menuBar.setEnabled('menuPhoto', True)
if fitsfile.pilResized:
self.title = "Vista al "+str(fitsfile.percresize)+"% delle dimensioni originali"
def getAndSaveImage(self):
try:
imageFromPil = self.pilImage
except:
imageFromPil = False
if imageFromPil:
aStyle = wx.SAVE | wx.HIDE_READONLY | wx.OVERWRITE_PROMPT
result = dialog.saveFileDialog(self, self.getText('SaveDialog_SaveAs'), self.userhome, self._parent.components.FileName.text, 'BMP File: (*.bmp)|*.bmp|JPG File: (*.jpg)|*.jpg', aStyle)
if result.accepted:
path=result.paths[0]
if not os.path.splitext(os.path.split(path)[1])[1]:
dialog.alertDialog(self, self.getText('SaveDialog_alertSaveAs'))
self.getAndSaveImage()
else:
imageFromPil.save(path)
def on_saveas_command(self, event):
self.getAndSaveImage()
def getText(self, item):
return self.ItemText(self.lang, self.gui, item)
def on_size(self, event):
self.panel.SetSize(self.size)
def run():
#app = model.Application(FitsOpener, './gui/fitsopener.rsrc.py')
app = twistedModel.TwistedModelApplication(FitsOpener, './gui/fitsopener.rsrc.py')
app.MainLoop()
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u"Fits's Opener",
'size':(820, 581),
'menubar': {'type':'MenuBar',
'menus': [
{'type':'Menu',
'name':'menuFile',
'label':'&File',
'items': [
{'type':'MenuItem',
'name':'menuFileOpen',
'label':u'O&pen..',
'command':'open',
},
{'type':'MenuItem',
'name':'menusaveas',
'label':u'Save as..',
'command':'saveas',
},
{'type':'MenuItem',
'name':'menuFileExit',
'label':'E&xit',
'command':'exit',
},
]
},
{'type':'Menu',
'name':'menuPhoto',
'label':'&Adjust',
'enabled':False,
'items': [
{'type':'MenuItem',
'name':'menuAdjustPhoto',
'label':'A&djust',
'command':'adjust',
},
]
},
]
},
'components': [
{'type':'Image',
'name':'ImageShow',
'position':(10, 10),
'size':(320, 240),
'file':u'./gui/img/Live.jpg',
},
] # end components
} # end background
] # end backgrounds
} }
from Pycard import model, dialog
class FocusDialog(model.Background):
def on_initialize(self, event):
self.parent = self.getParent()
def on_close(self, event):
self.parent.on_CloseFocus(event)
event.skip()
def on_exit_command(self, event):
self.close()
def on_size(self, event):
self.panel.SetSize(self.size)
def on_ButtonLess_mouseClick(self, event):
self.parent.on_FocusLess(event)
def on_ButtonPlus_mouseClick(self, event):
self.parent.on_FocusPlus(event)
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgFocus',
'title':u'Focus',
'size':(84, 71),
#'style':['wx.FRAME_TOOL_WINDOW', 'wx.MINIMIZE_BOX', 'wx.STAY_ON_TOP', 'wx.CLOSE_BOX', 'wx.CAPTION', 'wx.FRAME_SHAPED'],
'components': [
{'type':'Button',
'name':'ButtonLess',
'position':(47, 5),
'size':(32, -1),
'backgroundColor':(238, 238, 236, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
'label':'-',
},
{'type':'Button',
'name':'ButtonPlus',
'position':(5, 5),
'size':(32, -1),
'backgroundColor':(238, 238, 236, 255),
'font':{'faceName': u'Sans', 'family': 'sansSerif', 'size': 9},
'foregroundColor':(16, 16, 16, 255),
'label':'+',
},
] # end components
,
'sizers':
[
{
'name' : 'ALL',
'typ' : 'i',
'children' : [
{
'name' : 'TOP SIZER',
'typ' : 'v',
'horGrowth' : 1,
'verGrowth' : 1,
'children' : [
{
'name' : 'horsizer000',
'typ' : 'h',
'children' : [
{
'name' : 'ButtonPlus' },
{
'name' : 'ButtonLess' },
] # end of horsizer000
},
] # end of TOP SIZER
},
{
'name' : 'UNPLACED',
'typ' : 'i' },
] # end of ALL
},
] # end of sizers
} # end background
] # end backgrounds
} }
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
import wx
import math
from Pycard import model, resource
from skylive.lang import language
ID_OK=10
ID_CANCEL=15
ID_REG=20
ID_LOST=21
ID_NO=11
ID_LATER=12
ItemText = language.getItemText
def getText(item):
from skylive import config
lang = config.get_usrLang()
return ItemText(lang, 'gui', item)
class loginDialog(wx.Dialog):
def __init__(self):
wx.Dialog.__init__(self, None, wx.NewId(), "SkyLive Login",
style=wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP | wx.CAPTION)
self.main_sizer = wx.FlexGridSizer(cols=2, vgap=5, hgap=5)
self.username = wx.TextCtrl(self, 1, size=(150, -1))
self.main_sizer.Add(wx.StaticText(self, -1, "Username"),1, wx.ALIGN_CENTER)
self.main_sizer.Add(self.username, 1, wx.ALIGN_CENTER)
#self.main_sizer.Add(wx.StaticText(self, -1, " "),1, wx.ALIGN_CENTER)
self.password = wx.TextCtrl(self, -1, style=wx.TE_PASSWORD, size=(150, -1))
self.main_sizer.Add(wx.StaticText(self, -1, "Password"),1, wx.ALIGN_CENTER)
self.main_sizer.Add(self.password, 1, wx.ALIGN_CENTER)
#self.main_sizer.Add(wx.StaticText(self, -1, " "),1, wx.ALIGN_CENTER)
self.button_sizer = wx.FlexGridSizer(cols=2, vgap=5, hgap=5)
self.ok_button = wx.Button(self, ID_OK, "OK")
#self.main_sizer.Add(wx.StaticText(self, -1, " "),1, wx.ALIGN_CENTER)
self.button_sizer.Add(self.ok_button,1, wx.ALIGN_CENTER)
#self.main_sizer.Add(wx.StaticText(self, -1, " "),1, wx.ALIGN_CENTER)
wx.EVT_BUTTON(self, ID_OK, self.Ok)
self.cancel_button = wx.Button(self, ID_CANCEL, "CANCEL")
#self.main_sizer.Add(wx.StaticText(self, -1, " "),1, wx.ALIGN_CENTER)
self.button_sizer.Add(self.cancel_button, 1, wx.ALIGN_CENTER)
wx.EVT_BUTTON(self, ID_CANCEL, self.cancel)
# XXX Questo lo rimettiamo!
#self.reg_button = wx.Button(self, ID_REG, "new login")
#self.button_sizer.Add(self.reg_button, 1, wx.ALIGN_CENTER)
#wx.EVT_BUTTON(self, ID_REG, self.register)
# XXX Questo lo rimettiamo!
#self.lost_button = wx.Button(self, ID_LOST, "lost login")
#self.button_sizer.Add(self.lost_button, 1, wx.ALIGN_CENTER)
#wx.EVT_BUTTON(self, ID_LOST, self.lostaccount)
#self.hbox = wx.BoxSizer(wx.HORIZONTAL)
self.hbox = wx.BoxSizer(wx.VERTICAL)
self.hbox.Add(self.main_sizer, 1, wx.ALL | wx.EXPAND, 10)
self.hbox.Add(self.button_sizer, 1, wx.ALIGN_CENTER_HORIZONTAL, 1)
self.SetSizer(self.hbox)
self.SetAutoLayout(1)
self.hbox.Fit(self)
def register(self, event):
self.SetReturnCode( ID_REG )
self.EndModal( ID_REG )
#import register
#self.Pop = model.childWindow(self, register.Register, "./gui/register.rsrc.py")
#self.Pop.title = self.getText('downloadtitle')+size+" kb"
#self.Pop.components.downpr.text = self.getText('downloadtext')+size+" kb"
#self.Pop.visible = True
def lostaccount(self, event):
import lostaccount
self.Pop = model.childWindow(self, lostaccount.LostAccount, "./gui/lostaccount.rsrc.py")
#self.Pop.title = self.getText('downloadtitle')+size+" kb"
#self.Pop.components.downpr.text = self.getText('downloadtext')+size+" kb"
self.Pop.visible = True
def Ok(self, event):
self.SetReturnCode( ID_OK )
self.EndModal( ID_OK )
def cancel(self, event):
self.SetReturnCode( ID_CANCEL )
self.EndModal( ID_CANCEL )
def OldLogin():
dl=loginDialog()
dl.Enable(enable=True)
mainbg = wx.GetApp().getCurrentBackground()
ret = dl.ShowModal()
if ID_OK==ret:
user = dl.username.GetValue()
pwd = dl.password.GetValue()
if len(user) < 1:
user=None
if len(pwd) < 4:
pwd=None
print 'OK'
return [user, pwd]
elif ID_CANCEL==ret:
user = "stoplogin"
pwd = "stoplogin"
print 'CANCEL'
return [user, pwd]
elif ID_REG==ret:
import register,time
Pop = model.childWindow(mainbg, register.Register, "./gui/register.rsrc.py")
Pop.visible = True
Pop.done = False
while not Pop.done:
time.sleep(0.2)
print 'USCITO!'
else:
print 'NONE'
return [None, None]
def Login():
done=False
todo='login'
while not done:
if todo=='login':
dl=loginDialog()
dl.Enable(enable=True)
ret = dl.ShowModal()
if ID_OK==ret:
user = dl.username.GetValue()
pwd = dl.password.GetValue()
if len(user) < 1:
user=None
if len(pwd) < 4:
pwd=None
print 'OK'
done=True
retvar = [user, pwd]
elif ID_CANCEL==ret:
user = "stoplogin"
pwd = "stoplogin"
print 'CANCEL'
done=True
retvar = [user, pwd]
elif ID_REG==ret:
todo='register'
else:
print 'NONE'
done=True
retvar = [None, None]
elif todo=='register':
import register
dl=register.Register(wx.GetApp().getCurrentBackground(),
resource.ResourceFile("./gui/register.rsrc.py").getResource())
dl.visible=True
ret = dl.ShowModal()
print 'USCITO'
return retvar
upgradeText="""
Una nuova versione di SkyliveNG e' disponibile.
Vuoi aggiornare ora?
A new version of the SkyliveNG client is available.
Do you want to upgrade now?
"""
class upgradeDialog(wx.Dialog):
def __init__(self):
wx.Dialog.__init__(self, None, wx.NewId(), "SkyliveNG Upgrade",
style=wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP | wx.CAPTION)
self.main_sizer = wx.FlexGridSizer(cols=1, vgap=5, hgap=5)
self.main_sizer.Add(wx.StaticText(self, -1, getText("upgradeText")),1, wx.ALIGN_CENTER)
self.button_sizer = wx.FlexGridSizer(cols=3, vgap=5, hgap=5)
self.ok_button = wx.Button(self, ID_OK, "OK")
self.button_sizer.Add(self.ok_button,1, wx.ALIGN_CENTER)
wx.EVT_BUTTON(self, ID_OK, self.Ok)
self.no_button = wx.Button(self, ID_NO, "NO")
self.button_sizer.Add(self.no_button, 1, wx.ALIGN_CENTER)
wx.EVT_BUTTON(self, ID_NO, self.no)
self.later_button = wx.Button(self, ID_LATER, "LATER")
self.button_sizer.Add(self.later_button, 1, wx.ALIGN_CENTER)
wx.EVT_BUTTON(self, ID_LATER, self.later)
self.hbox = wx.BoxSizer(wx.VERTICAL)
self.hbox.Add(self.main_sizer, 1, wx.ALL | wx.EXPAND, 10)
self.hbox.Add(self.button_sizer, 0, wx.ALIGN_CENTER_HORIZONTAL, 1)
self.SetSizer(self.hbox)
self.SetAutoLayout(1)
self.hbox.Fit(self)
def Ok(self, event):
self.SetReturnCode( ID_OK )
self.EndModal( ID_OK )
def later(self, event):
self.SetReturnCode( ID_LATER )
self.EndModal( ID_LATER )
def no(self, event):
self.SetReturnCode( ID_NO )
self.EndModal( ID_NO )
def Upgrade():
du = upgradeDialog()
du.Enable(enable=True)
mainbg = wx.GetApp().getCurrentBackground()
ret = du.ShowModal()
if ID_OK==ret:
return 'UPGRADE'
elif ID_NO==ret:
return 'NOUPGRADE'
return 'LATERUPGRADE'
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u'Image Adjust',
'size':(446, 255),
'icon':'gui/img/ICONA.ico',
'backgroundColor':(192, 192, 192),
'components': [
{'type':'StaticBox',
'name':'adjustBox',
'position':(7, 10),
'size':(432, 160),
'label':'Image Adjust',
},
{'type':'StaticBox',
'name':'toolsBox',
'position':(7, 180),
'size':(432, 48),
'label':'Tools',
},
{'type':'StaticText',
'name':'luminanceTXT',
'position':(20, 68),
'text':'Luminance',
},
{'type':'Slider',
'name':'Bright',
'position':(95, 65),
'size':(300, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':100,
},
{'type':'StaticText',
'name':'contrastTXT',
'position':(20, 33),
'text':'Contrast',
},
{'type':'Slider',
'name':'Contrast',
'position':(95, 30),
'size':(299, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':100,
},
{'type':'StaticText',
'name':'contrShow',
'position':(400, 33),
'text':'1',
},
{'type':'StaticText',
'name':'brightShow',
'position':(400, 68),
'text':'1',
},
{'type':'StaticText',
'name':'StaticText4',
'position':(20, 138),
'text':'Str. Max',
},
{'type':'Slider',
'name':'strMax',
'position':(95, 135),
'size':(300, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':200,
},
{'type':'StaticText',
'name':'StaticText3',
'position':(20, 103),
'text':'Str. Min',
},
{'type':'Slider',
'name':'strMin',
'position':(95, 100),
'size':(300, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':0,
},
{'type':'StaticText',
'name':'strMinVal',
'position':(400, 103),
'text':'0',
},
{'type':'StaticText',
'name':'strMaxVal',
'position':(400, 138),
'text':'200',
},
{'type':'Button',
'name':'resetButton',
'position':(20, 199),
'size':(-1, 23),
'label':'Reset Change',
},
{'type':'Button',
'name':'negativeButton',
'position':(130, 199),
'size':(-1, 23),
'label':'Negative',
},
{'type':'Button',
'name':'autoContrastButton',
'position':(240, 199),
'size':(-1, 23),
'label':'AutoContrast',
},
{'type':'Button',
'name':'equalizeButton',
'position':(350, 199),
'size':(-1, 23),
'label':'Equalize',
},
] # end components
} # end background
] # end backgrounds
} }
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u'Image Adjust',
'size':(446, 238),
'icon':'gui/img/ICONA.ico',
'backgroundColor':(192, 192, 192),
'components': [
{'type':'StaticText',
'name':'luminanceTXT',
'position':(20, 68),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'Luminance',
},
{'type':'Slider',
'name':'Bright',
'position':(95, 65),
'size':(300, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':100,
},
{'type':'StaticText',
'name':'contrastTXT',
'position':(20, 33),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'Contrast',
},
{'type':'Slider',
'name':'Contrast',
'position':(95, 30),
'size':(299, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':100,
},
{'type':'StaticText',
'name':'contrShow',
'position':(400, 33),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'1',
},
{'type':'StaticText',
'name':'brightShow',
'position':(400, 68),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'1',
},
{'type':'StaticText',
'name':'maxTXT',
'position':(20, 138),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'Str. Max',
},
{'type':'Slider',
'name':'strMax',
'position':(95, 135),
'size':(300, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':200,
},
{'type':'StaticText',
'name':'minTXT',
'position':(20, 103),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'Str. Min',
},
{'type':'Slider',
'name':'strMin',
'position':(95, 100),
'size':(300, -1),
'labels':False,
'layout':'horizontal',
'max':200,
'min':0,
'value':0,
},
{'type':'StaticText',
'name':'strMinVal',
'position':(400, 103),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'0',
},
{'type':'StaticText',
'name':'strMaxVal',
'position':(400, 138),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'text':'200',
},
{'type':'StaticBox',
'name':'adjustBox',
'position':(7, 10),
'size':(432, 160),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'label':'Image Adjust',
},
{'type':'StaticBox',
'name':'toolsBox',
'position':(7, 180),
'size':(432, 48),
'font':{'style': 'bold', 'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'label':'Tools',
},
{'type':'Button',
'name':'resetButton',
'position':(20, 196),
'size':(92, 23),
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'label':'Reset Change',
},
{'type':'Button',
'name':'negativeButton',
'position':(130, 196),
'size':(-1, 23),
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'label':'Negative',
},
{'type':'Button',
'name':'autoContrastButton',
'position':(240, 196),
'size':(83, 23),
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'label':'AutoContrast',
},
{'type':'Button',
'name':'equalizeButton',
'position':(350, 196),
'size':(-1, 23),
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 8},
'label':'Equalize',
},
] # end components
} # end background
] # end backgrounds
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
"""
Copyright (C) 2007-2009 Franco Lanza <nextime@nexlab.it>
Copyright (C) 2007-2009 Sandro Aliano <ita595@hotmail.com>
Copyright (C) 2007-2009 Ivan Bellia <skylive@skylive.it>
Web site: http://www.astronomix.org/trac/Skylive-NG
This file is part of Skylive-NG.
Skylive-NG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Skylive-NG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Skylive-NG. If not, see <http://www.gnu.org/licenses/>.
"""
from Pycard import model
class infoBox(model.Background):
def on_initialize(self, event):
pass
def on_closeinfo_mouseClick(self, event):
self.close()
def on_size(self, event):
self.SetSizeHints(200, 150)
w, h = self.size
if w > 199 and h > 149:
self.components.htmlbox.size = (w-20, h-35)
self.components.closeinfo.posizion = ((w/2)-25, (h-35)+10)
self.panel.SetSize(self.size)
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':' ',
'icon':'gui/img/ICONA.ico',
'size':(530, 310),
'components': [
{'type':'Button',
'name':'closeinfo',
'position':(230, 285),
'size':(50, 25),
'label':u'Close',
},
{'type':'TextArea',
'name':'infobox',
'position':(10, 10),
'size':(510, 275),
'editable':False,
},
{'type':'InfoHtmlWindow',
'name':'htmlbox',
'position':(10, 10),
'size':(510, 275),
'editable':False,
'visible':False,
},
] # end components
} # end background
] # end backgrounds
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment