473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

plugin interface / list

hi,
i'm about to write a script to play various audio files. what i want to write
is a directory (module) containing wrappers around various players that supply
a player object (inheriting from a general player object defined earlier) and
an entry in a list of mime types (which player is for which type).
i've tried various forms of import and __init__.py configurations, but i
repeatedly have problems with the following steps:
- create an object inheriting from the main script
- fill the dictionary declared there
(i guess the problem is actually the same)

is there a standard way of doing such things?

thanks in advance
webograph
Nov 8 '05 #1
1 1157
webograph wrote:
hi,
i'm about to write a script to play various audio files. what i want to
write is a directory (module) containing wrappers around various players
that supply a player object (inheriting from a general player object
defined earlier) and an entry in a list of mime types (which player is
for which type).
i've tried various forms of import and __init__.py configurations, but i
repeatedly have problems with the following steps:
- create an object inheriting from the main script
- fill the dictionary declared there
(i guess the problem is actually the same)

is there a standard way of doing such things?

thanks in advance
webograph


Assuming that I understand your problem. One way is
(not tested):

class audioBase:
def __init__(self, **kwargs):
self.__dict__.extend(**kwargs)
return

#
# Define base methods
#

class mp3player(audioBase):
def __init__(self, **kwargs):
audioBase.__init__(self, **kwargs)
return

#
# Define mp3player specific methods
#
# Main program
#

obj=mp3Player(file='abc.mp3', <add other keyword arguments>)

-Larry Bates
Nov 9 '05 #2

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

Similar topics

2
by: Rudolf | last post by:
Dear NG, I want to create a Plugin System in C# (WinForms). Has anybody experience about this, tips, tricks, or any links. Thank you very much The DotNetJunkie
3
by: Roger Boesch | last post by:
Im currently working on a plugin architectur for a software product written in c# and have found the following problem: Project a) Application, Application with all classes used in this app ...
4
by: Jer | last post by:
Hi all, I am trying to get plugins working in my application. I am using the approach of writing an interface and then implementing that interface in each plugin. I would like to be able to...
2
by: Matt | last post by:
I'm hoping someone can steer me in the right direction to try to do the following: I am developing an application where we receive files from customers. Right now we receive a variety of...
2
by: Ron | last post by:
Hello, I'm attempting to develop a plugin framework for an application that I'm working on. I wish to develop something in which all plugins exist in a directory tree. The framework need only...
3
by: Rune Jacobsen | last post by:
Hello all, I mailed our common hero and fellow newsgroupian Jon Skeet a question regarding his article on plugins at http://www.yoda.arachsys.com/csharp/plugin.html, and he suggested that I...
3
by: auad | last post by:
hi, I'm having a problem with plugins....as follows: I have 3 projects: 2 class libraries and 1 Windows App (Project 1: ClassLibrary) I have a plugin interface:...
2
by: Aravind | last post by:
I have 3rd party dll plugin COM interface, when loaded executes the following functions. public class Test: IPlugin { public void Innitialize(IPluginApp obj, int pluginHandle) { //gets the...
1
by: Olie | last post by:
I was quite surprised to find virtually nothing about this but I may have been searching for the wrong thing. I want to know the best way to provide a programming interface to a plugin. I...
7
by: WTH | last post by:
I am now aware (I am primarily a C++ developer) that in C# if you reference the same interface from the same file in two different projects the types are actually incompatible. I found this out...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.