|
View:
New views
16 Messages
—
Rating Filter:
Alert me
|
|
|
[PATCH] wcmTouch and wcmTPCButton should be distinct propertiesThis applies on top of the property-rework branch.
------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: [PATCH] wcmTouch and wcmTPCButton should be distinct propertiesThomas Jaeger wrote:
> This applies on top of the property-rework branch. Sorry, forgot the attachment. >From b1b8c505b10619a08df703691f241162c353c845 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger <ThJaeger@...> Date: Mon, 5 Oct 2009 12:32:37 -0400 Subject: [PATCH] wcmTouch and wcmTPCButton should be distinct properties Expose wcmTouch as "Wacom Enable Touch" and !wcmTPCButton as "Wacom Hover Click". --- src/wcmXCommand.c | 36 ++++++++++++++++++++---------------- 1 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c index 756c1e7..189a7fa 100644 --- a/src/wcmXCommand.c +++ b/src/wcmXCommand.c @@ -395,7 +395,8 @@ Atom prop_cursorprox; Atom prop_capacity; Atom prop_threshold; Atom prop_suppress; -Atom prop_extrabuttons; +Atom prop_touch; +Atom prop_hover; static Atom InitWcmAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values) { @@ -494,10 +495,11 @@ void InitWcmDeviceProperties(LocalDevicePtr local) values[1] = common->wcmRawSample; prop_suppress = InitWcmAtom(local->dev, "Wacom Sample and Suppress", 32, 2, values); - values[0] = common->wcmTPCButton; - values[1] = common->wcmTouch; - prop_extrabuttons = InitWcmAtom(local->dev, "Wacom Extra Buttons", 8, 2, values); + values[0] = common->wcmTouch; + prop_touch = InitWcmAtom(local->dev, "Wacom Enable Touch", 8, 1, values); + values[0] = !common->wcmTPCButton; + prop_hover = InitWcmAtom(local->dev, "Wacom Hover Click", 8, 1, values); } int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, @@ -716,28 +718,30 @@ int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (!checkonly && common->wcmThreshold != value) common->wcmThreshold = value; - } else if (property == prop_extrabuttons) + } else if (property == prop_touch) { CARD8 *values = (CARD8*)prop->data; - if (prop->size != 2 || prop->format != 8) + if (prop->size != 1 || prop->format != 8) return BadValue; - /* TCPButton */ if ((values[0] != 0) && (values[0] != 1)) return BadValue; - /* TOUCH */ - if ((values[1] != 0) && (values[1] != 1)) + if (!checkonly && common->wcmTouch != values[1]) + common->wcmTouch = values[1]; + } else if (property == prop_hover) + { + CARD8 *values = (CARD8*)prop->data; + + if (prop->size != 1 || prop->format != 8) return BadValue; - if (!checkonly) - { - if (common->wcmTPCButton != values[0]) - common->wcmTPCButton = values[0]; - if (common->wcmTouch != values[1]) - common->wcmTouch = values[1]; - } + if ((values[0] != 0) && (values[0] != 1)) + return BadValue; + + if (!checkonly && common->wcmTPCButton != !values[0]) + common->wcmTPCButton = !values[0]; } return Success; -- 1.6.3.3 ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: [PATCH] wcmTouch and wcmTPCButton should be distinct propertiesOn Mon, Oct 05, 2009 at 12:39:44PM -0400, Thomas Jaeger wrote:
> Thomas Jaeger wrote: > > This applies on top of the property-rework branch. > > Sorry, forgot the attachment. > From b1b8c505b10619a08df703691f241162c353c845 Mon Sep 17 00:00:00 2001 > From: Thomas Jaeger <ThJaeger@...> > Date: Mon, 5 Oct 2009 12:32:37 -0400 > Subject: [PATCH] wcmTouch and wcmTPCButton should be distinct properties > > Expose wcmTouch as "Wacom Enable Touch" and !wcmTPCButton as > "Wacom Hover Click". Sorry for the delay, bit flooded here. Is it necessary to split those two up? I named it "Extra buttons" because I couldnt really think of something better but they seem connected enough to justify a single property. As Ping said in the other email, properties don't need to be human-readable beyond a certain extent and I'd like to avoid having dozens of single-value properties that all enable or disable a feature. To me it seemed that touch and TPCButton are both a kind of button so they go well together. I'm happy to be convinced otherwise. Cheers, Peter > --- > src/wcmXCommand.c | 36 ++++++++++++++++++++---------------- > 1 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c > index 756c1e7..189a7fa 100644 > --- a/src/wcmXCommand.c > +++ b/src/wcmXCommand.c > @@ -395,7 +395,8 @@ Atom prop_cursorprox; > Atom prop_capacity; > Atom prop_threshold; > Atom prop_suppress; > -Atom prop_extrabuttons; > +Atom prop_touch; > +Atom prop_hover; > > static Atom InitWcmAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values) > { > @@ -494,10 +495,11 @@ void InitWcmDeviceProperties(LocalDevicePtr local) > values[1] = common->wcmRawSample; > prop_suppress = InitWcmAtom(local->dev, "Wacom Sample and Suppress", 32, 2, values); > > - values[0] = common->wcmTPCButton; > - values[1] = common->wcmTouch; > - prop_extrabuttons = InitWcmAtom(local->dev, "Wacom Extra Buttons", 8, 2, values); > + values[0] = common->wcmTouch; > + prop_touch = InitWcmAtom(local->dev, "Wacom Enable Touch", 8, 1, values); > > + values[0] = !common->wcmTPCButton; > + prop_hover = InitWcmAtom(local->dev, "Wacom Hover Click", 8, 1, values); > } > > int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, > @@ -716,28 +718,30 @@ int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, > > if (!checkonly && common->wcmThreshold != value) > common->wcmThreshold = value; > - } else if (property == prop_extrabuttons) > + } else if (property == prop_touch) > { > CARD8 *values = (CARD8*)prop->data; > > - if (prop->size != 2 || prop->format != 8) > + if (prop->size != 1 || prop->format != 8) > return BadValue; > > - /* TCPButton */ > if ((values[0] != 0) && (values[0] != 1)) > return BadValue; > > - /* TOUCH */ > - if ((values[1] != 0) && (values[1] != 1)) > + if (!checkonly && common->wcmTouch != values[1]) > + common->wcmTouch = values[1]; > + } else if (property == prop_hover) > + { > + CARD8 *values = (CARD8*)prop->data; > + > + if (prop->size != 1 || prop->format != 8) > return BadValue; > > - if (!checkonly) > - { > - if (common->wcmTPCButton != values[0]) > - common->wcmTPCButton = values[0]; > - if (common->wcmTouch != values[1]) > - common->wcmTouch = values[1]; > - } > + if ((values[0] != 0) && (values[0] != 1)) > + return BadValue; > + > + if (!checkonly && common->wcmTPCButton != !values[0]) > + common->wcmTPCButton = !values[0]; > } > > return Success; > -- > 1.6.3.3 ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: [PATCH] wcmTouch and wcmTPCButton should be distinct propertiesPeter Hutterer wrote:
> On Mon, Oct 05, 2009 at 12:39:44PM -0400, Thomas Jaeger wrote: >> Thomas Jaeger wrote: >>> This applies on top of the property-rework branch. >> Sorry, forgot the attachment. > >> From b1b8c505b10619a08df703691f241162c353c845 Mon Sep 17 00:00:00 2001 >> From: Thomas Jaeger <ThJaeger@...> >> Date: Mon, 5 Oct 2009 12:32:37 -0400 >> Subject: [PATCH] wcmTouch and wcmTPCButton should be distinct properties >> >> Expose wcmTouch as "Wacom Enable Touch" and !wcmTPCButton as >> "Wacom Hover Click". > > > Sorry for the delay, bit flooded here. > Is it necessary to split those two up? I named it "Extra buttons" because I > couldnt really think of something better but they seem connected enough to > justify a single property. > > As Ping said in the other email, properties don't need to be human-readable > beyond a certain extent and I'd like to avoid having dozens of single-value > properties that all enable or disable a feature. To me it seemed that touch > and TPCButton are both a kind of button so they go well together. I'm happy > to be convinced otherwise. TPCButton isn't really a button, it rather controls when a button press is sent: If the option is disabled the driver sends a click as soon as the side switch is pressed, otherwise it is necessary to tap the pen to get a click. This applies to all wacom devices, I think. Touch seems to (I don't actually have a device that supports touch) just enable or disable touch events. So we might be able to kill the property altogether and use the DEVICE_ENABLE control on the touch device instead. Tom ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Source QuestionI and another user, Favux, are some of the main upkeepers for wacom
tutorials on the ubuntu forums (Him more than I.) We have been running into a problem. Everytime a new release for linux-wacom comes out, all the old packages are deleted (as in http://prdownloads.sourceforge.net/linuxwacom/linuxwacom-0.8.4-2.tar.bz2) This causes problems since our tutorial just wgets the source. So whenever you update, we have to fix the tutorial right away, or it won't work. I have noticed on the list that you are moving over to another repository. Is there somewhere where all the packages are that we can download from so that we won't have this problem every time linux-wacom gets updated? Thanks! Kory ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: Source QuestionHi Kory,
Thank you for supporting linuxwacom project. I's say pointing to a "hard-coded" version is not a good idea - we would like to recommand them to the latest dash release since it normally fixes bugs for the base version, especially Production release. Overwriting minor releases is a commonly used method, especially in open source community where updates occur often. It might be easier to direct your readers to linuxwacom.sf.net and let them download the lastest (Production or Development) release. I know one click solution is what you are trying to achieve. I feel lucky for linuxwacom users on Ubuntu. You may want to create a website of your own so you can take control of it?..... Ping On Thu, Oct 8, 2009 at 2:49 PM, Kory Prince <korylprince@...> wrote:
I and another user, Favux, are some of the main upkeepers for wacom ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: [PATCH] wcmTouch and wcmTPCButton should be distinct propertiesOn Wed, Oct 7, 2009 at 11:55 PM, Thomas Jaeger <thjaeger@...> wrote:
Tom is right. TPCButton can be applied to all tablet models (default to on for TabletPC's and off for all the others). It is a common option, i.e., it turns on/off for all tools that are associated with the same tablet. Due to its common feature, maybe we can group it with a few other common options (commonDBG, Suppress, Threshold? They don't belong together, I feel). So, Peter, do you have any rules/preference for grouping them together?
Touch seems to (I don't actually have a device that supports touch) just How do we use the DEVICE_ENABLE control? Is it a generic property defined by evdev or other low level driver/module? Can we enable/disable at our wish from the driver? When we disable a device, do we just stop it from sending data to Xinput or something else? Sorry for asking you instead of searching for the answer myself. I am hoping to catch up with a shortcut.
Ping
------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: Source QuestionHi Ping,
Thanks for the reply. I managed to cook up a python script that may solve my problem. It automatically parses the linuxwacom website and download the latest release (with options to compile and install as well.) As long as you don't dramatically change the format of the website, the script should work. If anyone wants a copy of the script, email me and I'll send it to you (it's still in development stages.) Thanks everyone! Kory On Fri, 2009-10-09 at 07:07 -0700, Ping wrote: > Hi Kory, > > Thank you for supporting linuxwacom project. I's say pointing to a > "hard-coded" version is not a good idea - we would like to recommand > them to the latest dash release since it normally fixes bugs for the > base version, especially Production release. Overwriting minor > releases is a commonly used method, especially in open source > community where updates occur often. > > It might be easier to direct your readers to linuxwacom.sf.net and let > them download the lastest (Production or Development) release. I know > one click solution is what you are trying to achieve. I feel lucky for > linuxwacom users on Ubuntu. You may want to create a website of your > own so you can take control of it?..... > > Ping ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: Source QuestionHi Kory,
I can post your script if you don't mind sending me a copy (and don't mind publicly sharing it). Or I can add a link at linuxwacom.sf.net to your page. Let me know which way you prefer. Ping On Sun, Oct 11, 2009 at 10:30 AM, Kory Prince <korylprince@...> wrote: Hi Ping, ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: Source QuestionIt's not quite ready yet, and it needs some testing before I release it
to the world. Once it is ready, you can put it on the site. It will be gplv2. Kory On Sun, 2009-10-11 at 10:40 -0700, Ping wrote: > Hi Kory, > > I can post your script if you don't mind sending me a copy (and don't > mind publicly sharing it). Or I can add a link at linuxwacom.sf.net to > your page. Let me know which way you prefer. > > Ping > > On Sun, Oct 11, 2009 at 10:30 AM, Kory Prince <korylprince@...> > wrote: > Hi Ping, > Thanks for the reply. I managed to cook up a python > script that may > solve my problem. It automatically parses the linuxwacom > website and > download the latest release (with options to compile and > install as > well.) As long as you don't dramatically change the format of > the > website, the script should work. > If anyone wants a copy of the script, email me and I'll send > it to you > (it's still in development stages.) > Thanks everyone! > Kory > > > On Fri, 2009-10-09 at 07:07 -0700, Ping wrote: > > Hi Kory, > > > > Thank you for supporting linuxwacom project. I's say > pointing to a > > "hard-coded" version is not a good idea - we would like to > recommand > > them to the latest dash release since it normally fixes bugs > for the > > base version, especially Production release. Overwriting > minor > > releases is a commonly used method, especially in open > source > > community where updates occur often. > > > > It might be easier to direct your readers to > linuxwacom.sf.net and let > > them download the lastest (Production or Development) > release. I know > > one click solution is what you are trying to achieve. I feel > lucky for > > linuxwacom users on Ubuntu. You may want to create a website > of your > > own so you can take control of it?..... > > > > Ping > > > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: [PATCH] wcmTouch and wcmTPCButton should be distinct propertiesOn Sat, Oct 10, 2009 at 12:22:30PM -0700, Ping wrote:
> On Wed, Oct 7, 2009 at 11:55 PM, Thomas Jaeger <thjaeger@...> wrote: > > > On Wed, Oct 7, 2009 at 10:10 PM, Peter Hutterer <peter.hutterer@...>wrote: > > > Sorry for the delay, bit flooded here. > > > Is it necessary to split those two up? I named it "Extra buttons" because > > I > > > couldnt really think of something better but they seem connected enough > > to > > > justify a single property. > > > > > > As Ping said in the other email, properties don't need to be > > human-readable > > > beyond a certain extent and I'd like to avoid having dozens of > > single-value > > > properties that all enable or disable a feature. To me it seemed that > > touch > > > and TPCButton are both a kind of button so they go well together. I'm > > happy > > > to be convinced otherwise. > > TPCButton isn't really a button, it rather controls when a button press > > is sent: If the option is disabled the driver sends a click as soon as > > the side switch is pressed, otherwise it is necessary to tap the pen to > > get a click. This applies to all wacom devices, I think. > > > > Tom is right. TPCButton can be applied to all tablet models (default to on > for TabletPC's and off for all the others). It is a common option, i.e., it > turns on/off for all tools that are associated with the same tablet. Due to > its common feature, maybe we can group it with a few other common options > (commonDBG, Suppress, Threshold? They don't belong together, I feel). So, > Peter, do you have any rules/preference for grouping them together? no hard rules, I'm just trying to group them as they make sense. If they don't make sense in a group just split them up. There's nothing wrong with having properties that only have a single value, I'm just trying to avoid the case where we have too many properties that affect more or less the same thing. the closest thing I can come to a hard rule is that if you look at the list of properties exported by a device, you should know immediately which property the setting you want to change belongs to. so with the examples you mentioned, Suppress and Threshold are related enough that they could be grouped (if you want to). commonDBG definitely in its own property (though I'm not a big fan of that property anyway, this should be a DIX property). I'm happy to apply the patches Tom sent, his explanations where enough to convince me. > > Touch seems to (I don't actually have a device that supports touch) just > > enable or disable touch events. So we might be able to kill the > > property altogether and use the DEVICE_ENABLE control on the touch > > device instead. > > How do we use the DEVICE_ENABLE control? Is it a generic property defined > by evdev or other low level driver/module? Can we enable/disable at our > wish from the driver? When we disable a device, do we just stop it from > sending data to Xinput or something else? Sorry for asking you instead of > searching for the answer myself. I am hoping to catch up with a shortcut. DEVICE_ENABLE is a control provided by XI (XChangeDeviceControl), but since server 1.6 we have a "Device Enabled" property that achieves the same effect. so instead of wacom having its own property it's better to re-use this property from the client-side tools. you don't actually have to do anything special inside the driver to support this property, if a client toggles it, the DEVICE_OFF/DEVICE_ON control proc is called. If you need to toggle it from within the driver (I don't think this is the case here?) you can use XIChangeDeviceProperty. Cheers, Peter ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: [PATCH] wcmTouch and wcmTPCButton should be distinct propertiesOn Sun, Oct 11, 2009 at 7:59 PM, Peter Hutterer <peter.hutterer@...> wrote:
Great. Please commit Tom's (remove the part for wcmTouch). Tom, do you have time (and interest) to take care of the other properties as well? You definitely have a better understand of the properties than I do. Thank you in advance.
Yeah, I guess so. Ignore this one for now. I'll have to think about it when I get there to be sure. I am still dragged by xorg older than 1.6 and my own xsetwacom world. It will take a while for me to catch up..... Ping ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
getwacom.pyHi Ping.
I got my script to a place where I am willing to distribute it. I am attaching it. I would prefer that you upload it to your site, but if you want you can link to: http://www.theprinceonline.info/getwacom/getwacom.py (I'm just not sure about the long-term integrity of that link.) If you do post it to your site, you might want to make this note: At this time, getwacom.py doesn't support the --getbuilddeps option for non-Debian systems. If you have any questions, comments, or suggestions please email the author at korylprince [AT] gmail [DOTspam] com Thanks! Kory [getwacom.py] #!/usr/bin/python ########################################################## ## GetWacom ## ## Script to Download, Compile, and Install ## ## the latest Linux-Wacom Release ## ## Copyright 2009 Kory Prince <korylprince@...> ## ########################################################## # # # This program 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 2 of the License, or # (at your option) any later version. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Changelog: # 1.0 - First Version - 10/10/09 # 1.5 - Added directory option # Made hid-ids.h install much better # Major code cleanup - (varibles, True/False, etc) # Added --prefix option # Added User prompts with a --force-yes prompt. # Added many checks for options confliction # Added apt-get check # 10/12/09 import urllib2, re, os, getopt, sys def main(): """Main function that takes arguements from the command line.""" global wacompath, uname, force getbuilddeps, download, compilevar, install, wacompath, uname, prefix, force = False, False, False, False, os.getcwd(), os.uname()[2], "/usr", False try: opts, operands = getopt.getopt( sys.argv[1:], "dcghfi:", ["download=", "compile=", "install=", "getbuilddeps=", "help", "prefix=", "force-yes"] ) except getopt.GetoptError, err: print str(err) usage() sys.exit(2) for options in opts: if "--help" in options or "-h" in options: usage(helpstatus=True) sys.exit(2) #debug print opts, operands #Getting user-specified path if it exists if len(operands) > 1: print "You cannot specify more than one path." usage() sys.exit(2) if operands != []: wacompath = os.path.abspath(operands[0]) #Make sure the path is writable by the user perm = oct((os.stat(wacompath)[0]) & 0777) if ((int(perm[1]) > 5 ) and os.stat(wacompath)[4] == os.getuid()) or ((int(perm[2]) > 5) and os.stat(wacompath)[5] == os.getgid()) or (int(perm[3]) > 5): pass else: print wacompath + " is not writable!" sys.exit(1) print "##########" print "Using " + wacompath + " for download and compile path." for options in opts: #If using long name, true or false should be specified. if (options[0] == "--getbuilddeps"): if options[1].lower() == "true": getbuilddeps = True if (options[0] == "--download"): if options[1].lower() == "true": download = True if (options[0] == "--compile"): if options[1].lower() == "true": compilevar = True if (options[0] == "--install" or options[0] == "-i"): install = options[1].lower() if (options[0] == "--prefix"): prefix = options[1] if (options[0] == "--force-yes" or options[0] == "-y"): force = True #if using short name, it automates to true. if (options[0] == "-g"): getbuilddeps = True if (options[0] == "-d"): download = True if (options[0] == "-c"): compilevar = True print "We are about to:\nCheck the Latest Version of Linuxwacom" if getbuilddeps == True: print "Get Build Dependencies" if download == True: print "Download Latest Linuxwacom Package" if compilevar == True: if prefix != "/usr": print "Compile the Linuxwacom package with prefix " + prefix else: print "Compile the Linuxwacom package" if install != False and (install == "module" or install == "all"): print "Install the linuxwacom package as " + install if install == "module" or install == "all" and compilevar == False: print "WARNING: You have chosen to install without compiling. This will fail if you have not already compiled in " + wacompath shouldContinue() #We stick this here because there is no need to run it if the command exits improperly global wacomversion wacomversion = re.findall(r"(linuxwacom[\w\d\-\.][0-9-]\.[0-9\-]\.[0-9\-]+)", getLatestWacomUrl())[0] print "Latest Version: " + wacomversion if getbuilddeps == True: getBuildDeps() elif getbuilddeps == False: pass else: print "Option " + getbuilddeps + "is not a valid option for --getbuilddeps." usage() sys.exit(2) if download == True: getWacom() elif download == False: pass else: print "Option " + download + "is not a valid option for --download." usage() sys.exit(2) if compilevar == True: compileWacom(prefix) elif compilevar == False: pass else: print "Option " + compilevar + "is not a valid option for --download." usage() sys.exit(2) if install == "module" or install == "all": installWacom(install) elif install == False: pass else: print "Option " + install + "is not a valid option for --install." usage() sys.exit(2) print "All Done!" #################################################################################### # Done with main Function. # #################################################################################### def shouldContinue(): """Asks user if it should continue and waits for answer. Use --force-yes to skip.""" if force == True: return None answer = raw_input("Do you wish to continue? (Y/n):") yes = ("y", "Y", "yes", "YES", "") if answer in yes: pass else: print "Stopping." sys.exit(1) def usage(helpstatus=False): """Displays usage text. If helpstatus is true it displays the full text.""" if helpstatus == False: print """ Usage: getwacom.py [OPTION]... [download/compile path] OPTION takes the form of --OPTION[=option] Use 'getwacom.py --help' for more information.""" else: print """ Usage getwacom.py [OPTION]... [download/compile path] Download/compile path defaults to current directory unless specified. OPTION takes the form of --OPTION[=option] or -o Options do not need to be in any specific order. Available Options: (Defaults Capitalized.) --compile=true/FALSE Whether or not to compile -c release. --download=true/FALSE Whether or not to download -d latest linuxwacom release. --force-yes If enabled, prompts are -f skipped. --getbuilddeps=true/FALSE Whether or not to install -g build dependencies. --help Show this help message. -h --install=MODULE/all Whether or not to install. -i=MODULE/all Install as Module only, or the whole release. --prefix= Option to specify compile prefix. Default is /usr. Copyright Kory Prince 2009 - getwacom.py Version 1.5""" def parseAddress(address): """Takes an address and puts an 'http://' on it if not already there.""" if address[:7] != "http://": if address.find("://") != -1: print "Error: Cannot retrieve URL, protocol must be HTTP" sys.exit(1) else: address = "http://" + address return address def getWebsite(address): """Downloads address and puts returns the html""" fulladdress = parseAddress(address) try: website = urllib2.urlopen(fulladdress) except urllib2.HTTPError, e: print "Cannot retrieve URL: HTTP Error Code", e.code except urllib2.URLError, e: print "Cannot retrieve URL: " + e.reason[1] return website.read() def getLatestWacomUrl(): """parses the linuxwacom site and finds the newest version. Returns url for download.""" print "Checking for latest version..." html = getWebsite('http://linuxwacom.sourceforge.net/') #Sweet regex that finds any http(s) link with a bz2 file extension urlfind= r"(https?://+[\w\d:#@%/;$()~_?\+-=\\\.&]*bz2)" matchedurls = re.findall(urlfind,html) if matchedurls[0][-11] > matchedurls[1][-11]: return matchedurls[0] elif matchedurls[0][-11] < matchedurls[1][-11]: return matchedurls[1] else: if matchedurls[0][-9] > matchedurls[1][-9]: return matchedurls[0] elif matchedurls[0][-9] < matchedurls[1][-9]: return matchedurls[1] def getWacom(): """downloads and untars the latest wacom release""" url = getLatestWacomUrl() os.chdir(wacompath) print "Downloading Latest Release - " + wacomversion os.system("wget -m -nd " + url) print "Untarring package." os.system("tar xjvf " + wacomversion + ".tar.bz2") return None def getBuildDeps(): """Gets all the packages to compile linuxwacom""" aptexists = False for path in os.environ["PATH"].split(":"): if os.path.exists(path + "/apt-get"): aptexists = True if aptexists == False: print "--getbuilddeps currently only works on systems with apt-get installed! (Debian-based systems.)" sys.exit(1) print "Updating APT." shouldContinue() os.system("gksudo apt-get update") print "Installing required packages." os.system("sudo apt-get -y install build-essential libx11-dev libxi-dev x11proto-input-dev xserver-xorg-dev tk8.4-dev tcl8.4-dev libncurses5-dev linux-headers-"+(re.findall(r'([a-z]+)', uname)[0])) getHIDFile() def getHIDFile(): """Function to check if hid-ids.h file exists. If it does not then it is downloaded. Mainly for ubuntu Karmic.""" sourcefilepath = None print "Checking for hid-ids.h file." for location in ("/lib/modules/"+uname+"/source", "/lib/modules/"+uname+"/build", "/usr/src/linux /usr/src/linux-"+uname, "/usr/src/linux-2.6"): if os.path.exists(location + "/include/linux/input.h"): sourcefilepath = location break if sourcefilepath == None: print "Cannot find Header information. Make sure it is installed!" if os.path.exists(location + "/drivers/hid/hid-ids.h"): print "Found it! " + location + "/drivers/hid/hid-ids.h" else: print "File does not exist. Downloading from kernel.ubuntu.com." os.system("sudo wget -O " + location + "/drivers/hid/hid-ids.h http://kernel.ubuntu.com/git-repos/ubuntu/linux-2.6/drivers/hid/hid-ids.h") def compileWacom(prefix): """Compiles linuxwacom""" try: os.chdir(wacompath + "/" + wacomversion) except OSError: print "Cannot find linuxwacom path " + (wacompath + "/" + wacomversion) + ". Try running getwacom.py with --download=true." sys.exit(1) if prefix != "/usr": print "Preparing to compile with prefix " + prefix + "." else: print "Preparing to compile." shouldContinue() print "Configuring." os.system("./configure --enable-wacom --prefix=" + prefix) print "Compiling" os.system("make") os.chdir(wacompath) def installWacom(install="module"): """Installs linux wacom either as a module only or as all.""" try: os.chdir(wacompath + "/" + wacomversion) except OSError: print "Cannot find linuxwacom path " + (wacompath + "/" + wacomversion) + ". Try running getwacom.py with --download=true." sys.exit(1) print "Preparing to install as " + install + "." shouldContinue() if install == "all": print "Installing All." os.system("gksudo make install") else: print "Installing Module only." os.system("gksudo cp ./src/" + uname[0:6] + "/wacom.ko /lib/modules/" + uname + "/kernel/drivers/input/tablet/wacom.ko") os.chdir(wacompath) if __name__ == '__main__': main() ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: getwacom.pyHi Kory,
Your script is linked to http://linuxwacom.sourceforge.net/index.php/howto/install. Please take a look and let me know if it represents your original suggestion or not. Thank you so much on behalf of Debian-based users (if they allow me to do so :). Ping On Mon, Oct 12, 2009 at 4:34 PM, Kory Prince <korylprince@...> wrote: Hi Ping. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: getwacom.pyHi Ping!
Sorry it took so long to answer... I have been a bit busy. The page looks great, but I did something that may help us both a lot. I went ahead and created a sourceforge project for the script itself so you I won't have to send you the new version everytime and you won't have to change the link. Just change the link to the sourceforge page for the script: https://sourceforge.net/projects/getwacom/files/ Also, Just so you know, the script should work on non-debian systems. Only one switch does not work, and the script handles this itself. Also in the future I plan to add support for other systems. Thanks for all your help! Kory On Wed, 2009-10-14 at 15:07 -0700, Ping wrote: > Hi Kory, > > Your script is linked to > http://linuxwacom.sourceforge.net/index.php/howto/install. Please > take a look and let me know if it represents your original suggestion > or not. > > Thank you so much on behalf of Debian-based users (if they allow me to > do so :). > > Ping > > On Mon, Oct 12, 2009 at 4:34 PM, Kory Prince <korylprince@...> > wrote: > Hi Ping. > I got my script to a place where I am willing to > distribute it. I am > attaching it. > I would prefer that you upload it to your site, but if you > want you can > link to: > http://www.theprinceonline.info/getwacom/getwacom.py > > (I'm just not sure about the long-term integrity of that > link.) > > If you do post it to your site, you might want to make this > note: > > At this time, getwacom.py doesn't support the --getbuilddeps > option for > non-Debian systems. > If you have any questions, comments, or suggestions please > email the > author at korylprince [AT] gmail [DOTspam] com > > Thanks! > Kory > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
|
|
Re: getwacom.pyhttp://linuxwacom.sourceforge.net/index.php/howto/install has been updated with the new link. Thank you Kory.
Ping
On Tue, Oct 20, 2009 at 6:12 PM, Kory Prince <korylprince@...> wrote: Hi Ping! ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@... https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
| Free embeddable forum powered by Nabble | Forum Help |