linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #08159
[Branch ~dcplusplus-team/dc-plugin-sdk/trunk] Rev 37: - Move Python helpers to their own directory.
------------------------------------------------------------
revno: 37
committer: poy <poy@xxxxxxxxxx>
branch nick: dc-plugin-sdk
timestamp: Fri 2014-07-04 00:18:22 +0200
message:
- Move Python helpers to their own directory.
- Use relative imports.
- Code formatting.
- Remove unnecessary platform defs in example info.xml files.
added:
Libraries/PythonInterface/
renamed:
Libraries/PyPlugin.DataTypes/ => Libraries/PythonInterface/dcplugin/
modified:
Examples/Python-Skeleton/MyPlugin.py
Examples/Python-Skeleton/copy.bat
Examples/Python-Skeleton/info_27.xml
Examples/Python-Skeleton/info_27_x64.xml
Examples/Python-Skeleton/info_34.xml
Examples/Python-Skeleton/info_34_x64.xml
Libraries/PythonInterface/dcplugin/DCPluginBase.py
Libraries/PythonInterface/dcplugin/DCPluginSinkProxy.py
Libraries/PythonInterface/dcplugin/DataTypes.py
Libraries/PythonInterface/dcplugin/Enumerations.py
Libraries/PythonInterface/dcplugin/IDCPlugin.py
Libraries/PythonInterface/dcplugin/IDCPluginSink.py
Libraries/PythonPlugin/Marshalling.cpp
Libraries/PythonPlugin/Plugin.cpp
--
lp:dc-plugin-sdk
https://code.launchpad.net/~dcplusplus-team/dc-plugin-sdk/trunk
Your team Dcplusplus-team is subscribed to branch lp:dc-plugin-sdk.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dc-plugin-sdk/trunk/+edit-subscription
=== modified file 'Examples/Python-Skeleton/MyPlugin.py'
--- Examples/Python-Skeleton/MyPlugin.py 2014-07-02 20:25:43 +0000
+++ Examples/Python-Skeleton/MyPlugin.py 2014-07-03 22:18:22 +0000
@@ -1,20 +1,24 @@
import DCPluginSink
-from Enumerations import *
-from DataTypes import *
-from IDCPluginSink import *
-from IDCPlugin import *
-from DCPluginBase import *
-from DCPluginSink import *
-from DCPluginSinkProxy import *
+from dcplugin.DataTypes import *
+from dcplugin.DCPluginBase import *
+from dcplugin.DCPluginSinkProxy import *
+from dcplugin.Enumerations import *
+from dcplugin.IDCPlugin import *
+from dcplugin.IDCPluginSink import *
+
class MyPlugin(DCPluginBase):
def __init__(self):
- return None;
+ return None # TODO dafuq
def OnChatIncoming(self, hubData, paramData):
if paramData == "test":
- self.LogMessage("Test? Here's a test for you. In Python!");
- self.sink.SendMessage(hubData, "Python Test? Here's a test for you. In Python!", False);
+ self.LogMessage("Test? Here's a test for you. In Python!")
+ self.sink.SendMessage(
+ hubData,
+ "Python Test? Here's a test for you. In Python!",
+ False
+ )
- return DCPluginBase.OnChatIncoming(self,hubData, paramData);
+ return DCPluginBase.OnChatIncoming(self,hubData, paramData)
=== modified file 'Examples/Python-Skeleton/copy.bat'
--- Examples/Python-Skeleton/copy.bat 2014-07-02 20:25:43 +0000
+++ Examples/Python-Skeleton/copy.bat 2014-07-03 22:18:22 +0000
@@ -1,8 +1,8 @@
-mkdir MyPlugin_%1_%2
+md MyPlugin_%1_%2\dcplugin
xcopy /y info_%1_%2.xml MyPlugin_%1_%2\
xcopy /y MyPlugin.py MyPlugin_%1_%2\
xcopy /y ..\..\Libraries\PythonPlugin\%2\Release\PythonPlugin_%1.dll MyPlugin_%1_%2\
-xcopy /y ..\..\Libraries\PyPlugin.DataTypes\* MyPlugin_%1_%2\
+xcopy /y ..\..\Libraries\PythonInterface\dcplugin\*.py MyPlugin_%1_%2\dcplugin
xcopy /y Python%1_%2.dll MyPlugin_%1_%2\
move /y MyPlugin_%1_%2\Python%1_%2.dll MyPlugin_%1_%2\Python%1.dll
move /y MyPlugin_%1_%2\info_%1_%2.xml MyPlugin_%1_%2\info.xml
=== modified file 'Examples/Python-Skeleton/info_27.xml'
--- Examples/Python-Skeleton/info_27.xml 2014-07-02 20:25:43 +0000
+++ Examples/Python-Skeleton/info_27.xml 2014-07-03 22:18:22 +0000
@@ -28,16 +28,16 @@
<Website>N/A</Website>
<Plugin Platform="pe-x86">PythonPlugin.dll</Plugin>
<Files>
- <File Platform="pe-x86">__init__.py</File>
- <File Platform="pe-x86">DataTypes.py</File>
- <File Platform="pe-x86">DCPluginBase.py</File>
- <File Platform="pe-x86">DCPluginSinkProxy.py</File>
- <File Platform="pe-x86">Enumerations.py</File>
- <File Platform="pe-x86">IDCPlugin.py</File>
- <File Platform="pe-x86">IDCPluginSink.py</File>
+ <File>dcplugin/__init__.py</File>
+ <File>dcplugin/DataTypes.py</File>
+ <File>dcplugin/DCPluginBase.py</File>
+ <File>dcplugin/DCPluginSinkProxy.py</File>
+ <File>dcplugin/Enumerations.py</File>
+ <File>dcplugin/IDCPlugin.py</File>
+ <File>dcplugin/IDCPluginSink.py</File>
<File Platform="pe-x86">Python27.dll</File>
- <File Platform="pe-x86">MyPlugin.py</File>
+ <File>MyPlugin.py</File>
</Files>
</dcext>
=== modified file 'Examples/Python-Skeleton/info_27_x64.xml'
--- Examples/Python-Skeleton/info_27_x64.xml 2014-07-02 20:25:43 +0000
+++ Examples/Python-Skeleton/info_27_x64.xml 2014-07-03 22:18:22 +0000
@@ -28,16 +28,16 @@
<Website>N/A</Website>
<Plugin Platform="pe-x64">PythonPlugin.dll</Plugin>
<Files>
- <File Platform="pe-x64">__init__.py</File>
- <File Platform="pe-x64">DataTypes.py</File>
- <File Platform="pe-x64">DCPluginBase.py</File>
- <File Platform="pe-x64">DCPluginSinkProxy.py</File>
- <File Platform="pe-x64">Enumerations.py</File>
- <File Platform="pe-x64">IDCPlugin.py</File>
- <File Platform="pe-x64">IDCPluginSink.py</File>
+ <File>dcplugin/__init__.py</File>
+ <File>dcplugin/DataTypes.py</File>
+ <File>dcplugin/DCPluginBase.py</File>
+ <File>dcplugin/DCPluginSinkProxy.py</File>
+ <File>dcplugin/Enumerations.py</File>
+ <File>dcplugin/IDCPlugin.py</File>
+ <File>dcplugin/IDCPluginSink.py</File>
<File Platform="pe-x64">Python27.dll</File>
- <File Platform="pe-x64">MyPlugin.py</File>
+ <File>MyPlugin.py</File>
</Files>
</dcext>
=== modified file 'Examples/Python-Skeleton/info_34.xml'
--- Examples/Python-Skeleton/info_34.xml 2014-07-02 20:25:43 +0000
+++ Examples/Python-Skeleton/info_34.xml 2014-07-03 22:18:22 +0000
@@ -28,16 +28,16 @@
<Website>N/A</Website>
<Plugin Platform="pe-x86">PythonPlugin.dll</Plugin>
<Files>
- <File Platform="pe-x86">__init__.py</File>
- <File Platform="pe-x86">DataTypes.py</File>
- <File Platform="pe-x86">DCPluginBase.py</File>
- <File Platform="pe-x86">DCPluginSinkProxy.py</File>
- <File Platform="pe-x86">Enumerations.py</File>
- <File Platform="pe-x86">IDCPlugin.py</File>
- <File Platform="pe-x86">IDCPluginSink.py</File>
+ <File>dcplugin/__init__.py</File>
+ <File>dcplugin/DataTypes.py</File>
+ <File>dcplugin/DCPluginBase.py</File>
+ <File>dcplugin/DCPluginSinkProxy.py</File>
+ <File>dcplugin/Enumerations.py</File>
+ <File>dcplugin/IDCPlugin.py</File>
+ <File>dcplugin/IDCPluginSink.py</File>
- <File Platform="pe-x86">Python34.dll</File>
+ <File Platform="pe-x86">Python34.dll</File>
- <File Platform="pe-x86">MyPlugin.py</File>
+ <File>MyPlugin.py</File>
</Files>
</dcext>
=== modified file 'Examples/Python-Skeleton/info_34_x64.xml'
--- Examples/Python-Skeleton/info_34_x64.xml 2014-07-02 20:25:43 +0000
+++ Examples/Python-Skeleton/info_34_x64.xml 2014-07-03 22:18:22 +0000
@@ -28,16 +28,16 @@
<Website>N/A</Website>
<Plugin Platform="pe-x64">PythonPlugin.dll</Plugin>
<Files>
- <File Platform="pe-x64">__init__.py</File>
- <File Platform="pe-x64">DataTypes.py</File>
- <File Platform="pe-x64">DCPluginBase.py</File>
- <File Platform="pe-x64">DCPluginSinkProxy.py</File>
- <File Platform="pe-x64">Enumerations.py</File>
- <File Platform="pe-x64">IDCPlugin.py</File>
- <File Platform="pe-x64">IDCPluginSink.py</File>
+ <File>dcplugin/__init__.py</File>
+ <File>dcplugin/DataTypes.py</File>
+ <File>dcplugin/DCPluginBase.py</File>
+ <File>dcplugin/DCPluginSinkProxy.py</File>
+ <File>dcplugin/Enumerations.py</File>
+ <File>dcplugin/IDCPlugin.py</File>
+ <File>dcplugin/IDCPluginSink.py</File>
- <File Platform="pe-x64">Python34.dll</File>
+ <File Platform="pe-x64">Python34.dll</File>
- <File Platform="pe-x64">MyPlugin.py</File>
+ <File>MyPlugin.py</File>
</Files>
</dcext>
=== added directory 'Libraries/PythonInterface'
=== renamed directory 'Libraries/PyPlugin.DataTypes' => 'Libraries/PythonInterface/dcplugin'
=== modified file 'Libraries/PythonInterface/dcplugin/DCPluginBase.py'
--- Libraries/PyPlugin.DataTypes/DCPluginBase.py 2014-07-03 19:35:55 +0000
+++ Libraries/PythonInterface/dcplugin/DCPluginBase.py 2014-07-03 22:18:22 +0000
@@ -1,140 +1,136 @@
-import traceback
-
-from Enumerations import *
-from DataTypes import *
-from IDCPluginSink import *
-from IDCPlugin import *
-from DCPluginSinkProxy import *
+from .Enumerations import *
+from .DataTypes import *
+from .DCPluginSinkProxy import *
+from .IDCPlugin import *
+from .IDCPluginSink import *
class DCPluginBase(IDCPlugin):
def __init__(self):
- self.info = PluginInformation();
- self.sink = None;
-
+ self.info = PluginInformation()
+ self.sink = None
+
""" Methods """
def Initialize(self, install, runtime):
""" if install: """
""" This only executes when the plugin has been installed for the first time. """
-
+
""" if runtime: """
- """ If the plugin doesn't support being enabled at runtime, cancel its loading here. """
+ """ If the plugin doesn't support being enabled at runtime, cancel its loading here. """
- return True;
+ return True
def Uninitialize(self):
- return True;
+ return True
def SetSink(self, paramSink):
- self.sink = DCPluginProxySink(paramSink);
+ self.sink = DCPluginProxySink(paramSink)
def SetPluginInfo(self, paramInfo):
- self.info = paramInfo;
+ self.info = paramInfo
""" Hooks """
""" Chat """
def OnChatIncoming(self, hubData, data):
- return False, False;
-
+ return False, False
+
def OnChatOutgoing(self, hubData, data):
- return False, False;
-
+ return False, False
+
def OnChatIncomingPM(self, userData, data):
- return False, False;
+ return False, False
""" Timer """
- def OnTimerSecond(self, data):
- return False, False;
+ def OnTimerSecond(self, data):
+ return False, False
- def OnTimerMinute(self, data):
- return False, False;
+ def OnTimerMinute(self, data):
+ return False, False
""" Hubs """
- def OnHubOnline(self, hubData):
- return False, False;
+ def OnHubOnline(self, hubData):
+ return False, False
- def OnHubOffline(self, hubData):
- return False, False;
+ def OnHubOffline(self, hubData):
+ return False, False
""" Users """
- def OnUserOnline(self, userData):
- return False, False;
+ def OnUserOnline(self, userData):
+ return False, False
- def OnUserOffline(self, userData):
- return False, False;
+ def OnUserOffline(self, userData):
+ return False, False
""" Network """
- def OnNetworkHubDataIn(self, hubData, data):
- return False, False;
-
- def OnNetworkHubDataOut(self, hubData, data):
- return False, False;
-
- def OnNetworkClientDataIn(self, connectionData, data):
- return False, False;
-
- def OnNetworkClientDataOut(self, connectionData, data):
- return False, False;
-
- def OnNetworkUDPDataIn(self, udpData, data):
- return False, False;
-
- def OnNetworkUDPDataOut(self, udpData, data):
- return False, False;
+ def OnNetworkHubDataIn(self, hubData, data):
+ return False, False
+
+ def OnNetworkHubDataOut(self, hubData, data):
+ return False, False
+
+ def OnNetworkClientDataIn(self, connectionData, data):
+ return False, False
+
+ def OnNetworkClientDataOut(self, connectionData, data):
+ return False, False
+
+ def OnNetworkUDPDataIn(self, udpData, data):
+ return False, False
+
+ def OnNetworkUDPDataOut(self, udpData, data):
+ return False, False
""" Queue """
- def OnQueueAdded(self, queueData):
- return False, False;
-
- def OnQueueMoved(self, queueData):
- return False, False;
-
- def OnQueueRemoved(self, queueData):
- return False, False;
-
- def OnQueueFinished(self, queueData):
- return False, False;
+ def OnQueueAdded(self, queueData):
+ return False, False
+
+ def OnQueueMoved(self, queueData):
+ return False, False
+
+ def OnQueueRemoved(self, queueData):
+ return False, False
+
+ def OnQueueFinished(self, queueData):
+ return False, False
""" UI """
- def OnUICreated(self, data):
- return False, False;
-
- def OnUIChatTags(self, userData, tagData):
- return False, False;
-
- def OnUIChatDisplay(self, userData, stringData):
- return False, False;
-
- def OnUIChatCommand(self, hubData, data):
- return False, False;
-
- def OnUIChatCommandPM(self, userData, data):
- return False, False;
+ def OnUICreated(self, data):
+ return False, False
+
+ def OnUIChatTags(self, userData, tagData):
+ return False, False
+
+ def OnUIChatDisplay(self, userData, stringData):
+ return False, False
+
+ def OnUIChatCommand(self, hubData, data):
+ return False, False
+
+ def OnUIChatCommandPM(self, userData, data):
+ return False, False
""" Methods """
-
- def LogException(self, exceptionMessage):
- self.LogError("An unknown exception occured: " + exceptionMessage);
-
- def LogException(self, exception):
- self.LogException(exception, True);
-
- def LogException(self, exception, logStacktrace):
+
+ def LogException(self, exception, logStacktrace=True):
if logStacktrace:
- self.LogError("An exception occured with stacktrace: " + exception.format_exc());
+ self.LogError(
+ "An exception occurred with stacktrace: " +
+ exception.format_exc()
+ )
else:
- self.LogError("An exception occured: " + exception.format_exc());
+ self.LogError(
+ "An exception occurred: " +
+ exception.format_exc()
+ )
def LogError(self, message):
- self.LogMessage("[ERROR] " + message);
-
+ self.LogMessage("[ERROR] " + message)
+
def LogWarning(self, message):
- self.LogMessage("[WARNING] " + message);
+ self.LogMessage("[WARNING] " + message)
def LogMessage(self, message):
- self.sink.LogMessage("[" + self.info.name + "] " + message);
-
-
+ self.sink.LogMessage("[" + self.info.name + "] " + message)
=== modified file 'Libraries/PythonInterface/dcplugin/DCPluginSinkProxy.py'
--- Libraries/PyPlugin.DataTypes/DCPluginSinkProxy.py 2014-07-03 19:35:55 +0000
+++ Libraries/PythonInterface/dcplugin/DCPluginSinkProxy.py 2014-07-03 22:18:22 +0000
@@ -1,134 +1,142 @@
import DCPluginSink
-from Enumerations import *
-from DataTypes import *
+from .Enumerations import *
+from .DataTypes import *
class DCPluginProxySink(object):
def __init__(self, paramSink):
- self._sink = paramSink;
-
+ self._sink = paramSink
+
""" Core """
def GetApplicationName(self):
- return DCPluginSink.GetApplicationName(self._sink);
-
+ return DCPluginSink.GetApplicationName(self._sink)
+
def SetApplicationName(self, name):
- DCPluginSink.SetApplicationName(self._sink, name);
+ DCPluginSink.SetApplicationName(self._sink, name)
""" Log """
def LogMessage(self, message):
- DCPluginSink.LogMessage(self._sink, message);
+ DCPluginSink.LogMessage(self._sink, message)
""" Config """
def GetInstallPath(self):
- return DCPluginSink.GetInstallPath(self._sink);
-
+ return DCPluginSink.GetInstallPath(self._sink)
+
def GetPath(self, pathType):
- return DCPluginSink.GetPath(self._sink, pathType);
+ return DCPluginSink.GetPath(self._sink, pathType)
def GetStringConfig(self, name):
- return DCPluginSink.GetStringConfig(self._sink, name);
+ return DCPluginSink.GetStringConfig(self._sink, name)
def SetStringConfig(self, name, value):
- DCPluginSink.SetStringConfig(self._sink, name, value);
-
+ DCPluginSink.SetStringConfig(self._sink, name, value)
+
def GetBoolConfig(self, name):
- return DCPluginSink.GetBoolConfig(self._sink, name);
- def SetBoolConfig(self, name, value):
- DCPluginSink.SetStringConfig(self._sink, name, value);
-
+ return DCPluginSink.GetBoolConfig(self._sink, name)
+ def SetBoolConfig(self, name, value):
+ DCPluginSink.SetStringConfig(self._sink, name, value)
+
def GetInt32Config(self, name):
- return DCPluginSink.GetInt32Config(self._sink, name);
- def SetInt32Config(self, name, value):
- DCPluginSink.SetStringConfig(self._sink, name, value);
-
+ return DCPluginSink.GetInt32Config(self._sink, name)
+ def SetInt32Config(self, name, value):
+ DCPluginSink.SetStringConfig(self._sink, name, value)
+
def GetInt64Config(self, name):
- return DCPluginSink.GetInt64Config(self._sink, name);
- def SetInt64Config(self, name, value):
- DCPluginSink.SetStringConfig(self._sink, name, value);
-
+ return DCPluginSink.GetInt64Config(self._sink, name)
+ def SetInt64Config(self, name, value):
+ DCPluginSink.SetStringConfig(self._sink, name, value)
+
def GetLanguage(self):
return DCPluginSink.GetLanguage(self._sink);
""" Connection """
def SendUDPData(self, ipAddress, port, data, amount):
- DCPluginSink.SendUDPData(self._sink, ipAddress, port, data, amount);
-
+ DCPluginSink.SendUDPData(self._sink, ipAddress, port, data, amount)
+
def SendProtocolCommandConnection(self, connectionData, command):
- DCPluginSink.SendProtocolCommandConnection(self._sink, connectionData, command);
-
+ DCPluginSink.SendProtocolCommandConnection(
+ self._sink, connectionData, command
+ )
+
def TerminateConnection(self, connectionData, graceLess):
- DCPluginSink.TerminateConnection(self._sink, connectionData, graceLess);
-
+ DCPluginSink.TerminateConnection(self._sink, connectionData, graceLess)
+
def GetConnectionUser(self, connectionData):
- return DCPluginSink.GetConnectionUser(self._sink, connectionData);
+ return DCPluginSink.GetConnectionUser(self._sink, connectionData)
""" Hub """
def AddHub(self, url, nick, password):
- return DCPluginSink.AddHub(self._sink, url, nick, password);
+ return DCPluginSink.AddHub(self._sink, url, nick, password)
def FindHub(self, url):
- return DCPluginSink.FindHub(self._sink, url);
-
+ return DCPluginSink.FindHub(self._sink, url)
+
def RemoveHub(self, hubData):
- DCPluginSink.RemoveHub(self._sink, hubData);
-
+ DCPluginSink.RemoveHub(self._sink, hubData)
+
def EmulateProtocolCommand(self, hubData, command):
- DCPluginSink.EmualteProtocolCommand(self._sink, hubData, command);
-
+ DCPluginSink.EmualteProtocolCommand(self._sink, hubData, command)
+
def SendProtocolCommandHub(self, hubData, command):
- DCPluginSink.SendProtocolCommandHub(self._sink, hubData, command);
-
+ DCPluginSink.SendProtocolCommandHub(self._sink, hubData, command)
+
def SendMessage(self, hubData, message, thirdPerson):
- DCPluginSink.SendMessage(self._sink, hubData, message, thirdPerson);
-
+ DCPluginSink.SendMessage(self._sink, hubData, message, thirdPerson)
+
def LocalMessage(self, hubData, message, messageType):
- DCPluginSink.LocalMessage(self._sink, hubData, message, messageType);
-
+ DCPluginSink.LocalMessage(self._sink, hubData, message, messageType)
+
def SendPrivateMessage(self, userData, message, thirdPerson):
- DCPluginSink.SendPrivateMessage(self._sink, userdata, message, thirdPerson);
-
+ DCPluginSink.SendPrivateMessage(
+ self._sink, userData, message, thirdPerson
+ )
+
def FindUser(self, cid, hubURL):
- return DCPluginSink.FindUser(self._sink, cid, hubURL);
+ return DCPluginSink.FindUser(self._sink, cid, hubURL)
""" Queue """
def AddList(self, userData, silent):
- return DCPluginSink.AddList(self._sink, userData, silent);
-
+ return DCPluginSink.AddList(self._sink, userData, silent)
+
def AddDownload(self, hashData, size, target):
- return DCPluginSink.AddDownload(self._sink, hashData, size, target);
-
+ return DCPluginSink.AddDownload(self._sink, hashData, size, target)
+
def FindDownload(self, target):
- return DCPluginSink.FindDownload(self._sink, target);
-
+ return DCPluginSink.FindDownload(self._sink, target)
+
def RemoveDownload(self, queueData):
- DCPluginSink.RemoveDownload(self._sink, queueData);
-
+ DCPluginSink.RemoveDownload(self._sink, queueData)
+
def SetPriority(self, queueData, priority):
- DCPluginSink.SetPriority(self._sink, queueData, priority);
-
+ DCPluginSink.SetPriority(self._sink, queueData, priority)
+
def Pause(self, queueData):
- return DCPluginSink.Pause(self._sink, queueData);
+ return DCPluginSink.Pause(self._sink, queueData)
""" Tagger """
def GetText(self, tagData):
- return DCPluginSink.GetText(self._sink, tagData);
-
+ return DCPluginSink.GetText(self._sink, tagData)
+
def AddTag(self, tagData, startPlace, endPlace, tagId, attributes):
- DCPluginSink.AddTag(self._sink, tagData, startPlace, endPlace, tagId, attributes);
-
+ DCPluginSink.AddTag(
+ self._sink, tagData, startPlace, endPlace, tagId, attributes
+ )
+
def ReplaceTagText(self, tagData, startPlace, endPlace, replacement):
- DCPluginSink.ReplaceTagText(self._sink, tagData, startPlace, endPlace, replacement);
+ DCPluginSink.ReplaceTagText(
+ self._sink, tagData, startPlace, endPlace, replacement
+ )
""" UI """
def AddCommand(self, name):
- DCPluginSink.AddCommand(self._sink, name);
-
+ DCPluginSink.AddCommand(self._sink, name)
+
def RemoveCommand(self, name):
- DCPluginSink.RemoveCommand(self._sink, name);
-
+ DCPluginSink.RemoveCommand(self._sink, name)
+
def PlaySoundInUI(self, path):
- DCPluginSink.PlaySoundInUI(self._sink, path);
-
+ DCPluginSink.PlaySoundInUI(self._sink, path)
+
def Notify(self, title, message):
- DCPluginSink.Notify(self._sink, title, message);
+ DCPluginSink.Notify(self._sink, title, message)
=== modified file 'Libraries/PythonInterface/dcplugin/DataTypes.py'
--- Libraries/PyPlugin.DataTypes/DataTypes.py 2014-07-03 19:42:13 +0000
+++ Libraries/PythonInterface/dcplugin/DataTypes.py 2014-07-03 22:18:22 +0000
@@ -1,82 +1,87 @@
+
class PluginSetting(object):
- def __init__(self, name, value, defaultValue, dataType, description, validValues):
- self.name = name;
- self.value = value;
- self.defaultvalue = defaultValue;
- self.datatype = dataType;
- self.description = description;
- self.validvalues = validValues;
+ def __init__(
+ self, name, value, defaultValue, dataType, description, validValues
+ ):
+ self.name = name
+ self.value = value
+ self.defaultvalue = defaultValue
+ self.datatype = dataType
+ self.description = description
+ self.validvalues = validValues
class CommandData(object):
def __init__(self, command, parameters):
- self.command = command;
- self.parameters = parameters;
+ self.command = command
+ self.parameters = parameters
class ConnectionData(object):
def __init__(self, ip, port, protocolType, isOperator, isEncrypted):
- self.ip = ip;
- self.port = port;
- self.protocolType = protocolType;
- self.isOperator = isOperator;
- self.isEncrypted = isEncrypted;
+ self.ip = ip
+ self.port = port
+ self.protocolType = protocolType
+ self.isOperator = isOperator
+ self.isEncrypted = isEncrypted
class HubData(object):
def __init__(self, url, ip, port, protocolType, isOp, isSecure):
- self.url = url;
- self.ip = ip;
- self.port = port;
- self.protocolType = protocolType;
- self.isOp = isOp;
- self.isSecure = isSecure;
+ self.url = url
+ self.ip = ip
+ self.port = port
+ self.protocolType = protocolType
+ self.isOp = isOp
+ self.isSecure = isSecure
class PluginInformation(object):
- def __init__(self, name, description, author, web, version, APIVersion, UUID):
- self.name = name;
- self.description = description;
- self.author = author;
- self.web = web;
- self.version = version;
- self.apiversion = APIVersion;
- self.uuid = UUID;
- """ self.settings = settings; """
+ def __init__(
+ self, name, description, author, web, version, APIVersion, UUID
+ ):
+ self.name = name
+ self.description = description
+ self.author = author
+ self.web = web
+ self.version = version
+ self.apiversion = APIVersion
+ self.uuid = UUID
+ # self.settings = settings;
class QueueData(object):
def __init__(self, target, location, hash_, filesize, isfilelist):
- self.target = target;
- self.location = location;
- self.hash = hash_;
- self.fileSize = filesize;
- self.isFileList = isfilelist;
+ self.target = target
+ self.location = location
+ self.hash = hash_
+ self.fileSize = filesize
+ self.isFileList = isfilelist
class StringData(object):
def __init__(self, input_, output_):
- self.input = input_;
- self.output = output_;
+ self.input = input_
+ self.output = output_
class TagData(object):
def __init__(self):
- self.isManaged = True;
+ self.isManaged = True
class UDPData(object):
def __init__(self, remoteAddress, port):
- self.remoteAddress = remoteAddress;
- self.port = port;
+ self.remoteAddress = remoteAddress
+ self.port = port
class UserData(object):
def __init__(self, nick, hubHint, cid, sid, protocol, isOperator):
- self.nick = nick;
- self.hubHint = hubHint;
- self.cid = cid;
- self.sid = sid;
- self.protocol = protocol;
- self.isOperator = isOperator;
+ self.nick = nick
+ self.hubHint = hubHint
+ self.cid = cid
+ self.sid = sid
+ self.protocol = protocol
+ self.isOperator = isOperator
=== modified file 'Libraries/PythonInterface/dcplugin/Enumerations.py'
--- Libraries/PyPlugin.DataTypes/Enumerations.py 2014-05-06 20:38:46 +0000
+++ Libraries/PythonInterface/dcplugin/Enumerations.py 2014-07-03 22:18:22 +0000
@@ -1,44 +1,48 @@
-def enum(**enums):
+
+def _enum(**enums):
return type('Enum', (), enums)
-def enum2(*sequential, **named):
+
+
+def _enum2(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
-TagPathType = enum2(
+
+TagPathType = _enum2(
'GlobalConfig',
'UserConfig',
'UserLocal',
'Resources',
'Locale'
- )
+)
-ProtocolType = enum2(
+ProtocolType = _enum2(
'ADC',
'NMDC',
'DHT'
- )
+)
-MessageType = enum2(
+MessageType = _enum2(
'Client',
'Status',
'System'
- )
-
-QueuePriority = enum(
- Default = -1,
- Lowest = 1,
- Low = 2,
- Normal = 3,
- High = 4,
- Highest = 5
- )
-
-DataType = enum2(
+)
+
+QueuePriority = _enum(
+ Default=-1,
+ Lowest=1,
+ Low=2,
+ Normal=3,
+ High=4,
+ Highest=5
+)
+
+DataType = _enum2(
'Unknown',
'String',
'Byte',
'Short',
'Int',
'Long'
- )
+)
=== modified file 'Libraries/PythonInterface/dcplugin/IDCPlugin.py'
--- Libraries/PyPlugin.DataTypes/IDCPlugin.py 2014-07-03 19:35:55 +0000
+++ Libraries/PythonInterface/dcplugin/IDCPlugin.py 2014-07-03 22:18:22 +0000
@@ -1,10 +1,10 @@
-from DataTypes import *
-from IDCPluginSink import *
+from .DataTypes import *
+from .IDCPluginSink import *
class IDCPlugin(object):
-
+
""" Methods """
def Initialize(self, install, runtime):
""" Initialization of the plugin.
=== modified file 'Libraries/PythonInterface/dcplugin/IDCPluginSink.py'
--- Libraries/PyPlugin.DataTypes/IDCPluginSink.py 2014-07-03 19:35:55 +0000
+++ Libraries/PythonInterface/dcplugin/IDCPluginSink.py 2014-07-03 22:18:22 +0000
@@ -1,12 +1,12 @@
-from DataTypes import *
+from .DataTypes import *
class IDCPluginSink(object):
""" Core """
def GetApplicationName(self): raise NotImplementedError
-
+
def SetApplicationName(self, name): raise NotImplementedError
""" Log """
@@ -14,21 +14,21 @@
""" Config """
def GetInstallPath(self): raise NotImplementedError
-
+
def GetPath(self, pathType): raise NotImplementedError
def GetStringConfig(self, name): raise NotImplementedError
def SetStringConfig(self, name, value): raise NotImplementedError
-
+
def GetBoolConfig(self, name): raise NotImplementedError
def SetBoolConfig(self, name, value): raise NotImplementedError
-
+
def GetInt32Config(self, name): raise NotImplementedError
def SetInt32Config(self, name, value): raise NotImplementedError
-
+
def GetInt64Config(self, name): raise NotImplementedError
def SetInt64Config(self, name, value): raise NotImplementedError
-
+
def GetLanguage(self): raise NotImplementedError
""" Connection """
@@ -66,4 +66,3 @@
def RemoveCommand(self, name): raise NotImplementedError
def PlaySoundInUI(self, path): raise NotImplementedError
def Notify(self, title, message): raise NotImplementedError
-
=== modified file 'Libraries/PythonPlugin/Marshalling.cpp'
--- Libraries/PythonPlugin/Marshalling.cpp 2014-06-29 21:56:27 +0000
+++ Libraries/PythonPlugin/Marshalling.cpp 2014-07-03 22:18:22 +0000
@@ -6,7 +6,7 @@
#include <iostream>
-const std::string DATATYPES_BINARY = "DataTypes";
+const std::string DATATYPES_BINARY = "dcplugin.DataTypes";
PyObject* CMarshalling::GetStringValue(const std::string& strValue)
{
=== modified file 'Libraries/PythonPlugin/Plugin.cpp'
--- Libraries/PythonPlugin/Plugin.cpp 2014-06-29 15:54:20 +0000
+++ Libraries/PythonPlugin/Plugin.cpp 2014-07-03 22:18:22 +0000
@@ -171,4 +171,4 @@
DCIMP void Plugin::ResetEnvironment(const std::wstring& strPath)
{
::SetCurrentDirectory(strPath.c_str());
-}
\ No newline at end of file
+}