[SATLUG] Re: Python Question

Matt Kinsel mkinsel at gmail.com
Thu Feb 14 12:43:34 CST 2008


Thanks! That did the trick.



On 2/14/08, phn1x <phnx.lists at gmail.com> wrote:
> replace the line system_alias_name = ...
>
> with
>
> if platform.system() == 'Linux':
>            system_alias_name = 'system'
>
> alternatively, you can just straight up assign the system_alias_name =
> 'system'
>
>
> That should work.
>
>
>
> On Thu, Feb 14, 2008 at 8:59 AM, Matt Kinsel <mkinsel at gmail.com> wrote:
>
> > I've never done any work with python, and I was hoping somebody who knows
> > a
> > little about it could help me here. There's a place in a certain
> > application
> > I have that says "Linux" where I want it to say something else, like
> > "System". I dug through the application's files and I think I found the
> > section that needs changing; I'm just not sure what to change. Here's the
> > excerpt:
> >
> > class ComputerTopic(Topic):
> >
> >    def __init__(self):
> >        import platform
> >        system_alias_name = platform.system_alias(platform.system(),
> >                                                  platform.release(),
> >                                                  platform.version())[0] or
> > _("Computer")
> >        Topic.__init__(self, system_alias_name, uri="topic://Computer")
> >
> >        from gimmie_running import ComputerRunningSource
> >        self.set_running_source_factory(lambda: ComputerRunningSource())
> >
> >        self.update_time_timeout_id = None
> >        self.current_time = 0
> >
> > FYI, everywhere else in the application files, the "Linux" I'm looking for
> > is signaled by "ComputerTopic". I'm guessing that ComputerTopic is
> > dynamically assigned to the platform/os I'm on, therefore I would need to
> > change that variable(s) to a static value, like System.
> >
> > TIA
> >
> > --
> > Matt Kinsel
> > www.mattkinsel.com
> > www.kinsel-kreations.com
> > --
> > _______________________________________________
> > SATLUG mailing list
> > SATLUG at satlug.org
> > http://alamo.satlug.org/mailman/listinfo/satlug to unsubscribe
> > Powered by Rackspace (www.rackspace.com)
> >
> --
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug to unsubscribe
> Powered by Rackspace (www.rackspace.com)
>


-- 
Matt Kinsel
www.mattkinsel.com
www.kinsel-kreations.com


More information about the SATLUG mailing list