473,656 Members | 2,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can i move attribute values from one class to another?

heres the deal.
i am working on a threading gui. pygtk
in one class (main) is all the gui stuff,
but in another class that is a thread, i am reading serial input.
what i want to be able to do is take what read in the thread and
print it in a textview in the gui class.

here is what i have:
class Serial1(threadi ng.Thread):
def __init__(self):
threading.Threa d.__init__(self )
def run(self):
ser = serial.Serial('/dev/ttyS15', 2400, timeout=None)
loopy = 1
while loopy < 5:
for x in range(5):
Input1Data = 'buncha data and timestamp\n'
gobject.idle_ad d(self.buffer_a dd, Input1Data)

def buffer_add(self , Input1Data):
Input1Iter = self.Input1Buff er.get_end_iter ()
self.Input1Buff er.insert(Input 1Iter, Input1Data)
class Main(SimpleGlad eApp):
def __init__(self, path="pivcontro lcenter.glade",
root="Main",
domain=app_name , **kwargs):
path = os.path.join(gl ade_dir, path)
SimpleGladeApp. __init__(self, path, root, domain, **kwargs)
self.MessageBuf fer = self.MessageVie w.get_buffer()

def on_StartEngines Button_clicked( self, widget, *args):
Input1Iter = self.MessageBuf fer.get_end_ite r()
Input1Data = 'Reading Serial device ttyS14 \n'
self.Input1Buff er.insert(Input 1Iter, Input1Data)
time.sleep(1)
S1 = Serial1()
S1.start()

basically, i need a way to pass data, actually the control of the
textview wiget
in and out of a class.
is this possible?

Sep 7 '05 #1
1 1242
oh wait.
never mind , i figgured it out!
thanks anyway

Sep 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1835
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute going to be available in the <a> and Html Controls as well as opposed to just the <asp:Button> control?
6
2482
by: Alex Hunsley | last post by:
I know that I can catch access to unknown attributes with code something like the following: class example: def __getattr__(self, name): if name == 'age': return __age else: raise AttributeError
13
2054
by: Patient Guy | last post by:
While the values of 'id' and 'name' attributes include restrictions on the use of characters such as beginning with a letter, the values of the 'class' attribute define no restriction as I can find. Thus the use of: class="thumbedImage 0.4" is permitted, and could be used as an attribute in IMG elements to identify images whose sizes I want to change dynamically with the loading of the
2
3952
by: Bill Cohagan | last post by:
In my app I'm validating an XML file against an XSD which contains several attribute default value specifications. I'm performing the validation via an xml document load() using a ValidatingXMLReader. After loading the document (and validating it) I assume that the resulting doc will (as appropriate) have elements with attributes set to their default values in those cases where there was nothing specified in the input XML file. However,...
2
3525
by: Harry F. Harrison | last post by:
I get 2 compile errors on assembly attributes after creating a custom attribute. If I comment out the attribute, the errors go away. I don't get it because my attribute specifies class usage, not assembly usage. Assembly attribute 'System.Runtime.InteropServices.GuidAttribute' is not valid: Assembly custom attribute 'System.Runtime.InteropServices.GuidAttribute' was specified multiple times with different values Attribute...
10
42954
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me, the XML specification seems a little ambiguous on this, so I defer to the XML authorities. Refer to sections 2.4 and 2.7 (it all hinges on if CDATA attribute values are part of markup or not.) Thanks.
10
3076
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
3
1749
by: Allerdyce.John | last post by:
I have a design type of quesiton. What is the advantages of using accessor (a getter/setter method) instead of making the attribute 'public'? If a class has public accessor (a getter/setter method) for its attribute, why not just make the attribute 'public'? It requires less code/typing. Or is there something I am missing? Thank you.
3
1880
by: Eric | last post by:
When i run my query it transfer last 4 digits of account number from one table to another and its wrong. There are two tables one i use for parsing. Second thru query i use to move data from temp table to actual table with some little changes in temp table. I use the same code in two different databases One database works fine and another database wont move the account number with 9 digit size. Difference is only the structre of text files...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.