diff --git a/plugins/Math/plugin.py b/plugins/Math/plugin.py index ea03b0064..00a78cf67 100644 --- a/plugins/Math/plugin.py +++ b/plugins/Math/plugin.py @@ -102,7 +102,10 @@ class Math(callbacks.Plugin): return cmath.sqrt(x) else: return math.sqrt(x) + def _cbrt(x): + return math.pow(x, 1.0/3) _mathEnv['sqrt'] = _sqrt + _mathEnv['cbrt'] = _cbrt _mathEnv['abs'] = abs _mathEnv['max'] = max _mathEnv['min'] = min diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 9f459d2e3..8b8b47882 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -302,7 +302,7 @@ class Misc(callbacks.Plugin): version = ''.join(version.rsplit(':', 1)) # Replace the last '-' by '+': version = '+'.join(version.rsplit('-', 1)) - versions[branch] = version + versions[branch] = version.encode('utf-8') newest = _('The newest versions available online are %s.') % \ ', '.join([_('%s (in %s)') % (y,x) for x,y in versions.items()]) diff --git a/plugins/PluginDownloader/plugin.py b/plugins/PluginDownloader/plugin.py index 89db121cd..8812f6805 100644 --- a/plugins/PluginDownloader/plugin.py +++ b/plugins/PluginDownloader/plugin.py @@ -172,9 +172,7 @@ class GithubRepository(GitRepository): archive = self._download(plugin) prefix = archive.getnames()[0] dirname = ''.join((self._path, plugin)) - print repr(prefix + dirname + '/README.txt') for file in archive.getmembers(): - print repr(file) if file.name == prefix + dirname + '/README.txt': extractedFile = archive.extractfile(file) return extractedFile.read() @@ -263,6 +261,8 @@ class PluginDownloader(callbacks.Plugin): which are available in that repository. When you want to install plugin, just run command "install ".""" + threaded = True + @internationalizeDocstring def repolist(self, irc, msg, args, repository): """[] diff --git a/plugins/Topic/plugin.py b/plugins/Topic/plugin.py index b7f2c599d..20bd5389f 100644 --- a/plugins/Topic/plugin.py +++ b/plugins/Topic/plugin.py @@ -573,6 +573,24 @@ class Topic(callbacks.Plugin): self._sendTopics(irc, channel, topics) swap = wrap(swap, ['canChangeTopic', 'topicNumber', 'topicNumber']) + @internationalizeDocstring + def save(self, irc, msg, args, channel): + """[] + + Saves the topic in to be restored with @topic default + later. is only necessary if the message isn't sent in + the channel itself. + """ + if not self._checkManageCapabilities(irc, msg, channel): + capabilities = self.registryValue('requireManageCapability') + irc.errorNoCapability(capabilities, Raise=True) + topic = irc.state.getTopic(channel) + if topic: + self.setRegistryValue('default', value=topic, channel=channel) + else: + self.setRegistryValue('default', value='', channel=channel) + save = wrap(save, ['canChangeTopic']) + @internationalizeDocstring def default(self, irc, msg, args, channel): """[] diff --git a/setup.py b/setup.py index 45332a3d3..543451b4a 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,7 @@ import subprocess plugins = [s for s in os.listdir('plugins') if os.path.exists(os.path.join('plugins', s, 'plugin.py'))] +version = None try: proc = subprocess.Popen('git show HEAD --format=%ci', shell=True, stdout=subprocess.PIPE) @@ -60,14 +61,17 @@ try: .replace(' +', '+') \ .replace(' ', 'T') - try: - os.unlink(os.path.join('src', 'version.py')) - except OSError: # Does not exist - pass - open(os.path.join('src', 'version.py'), 'a').write( - "version = '0.83.4.1+limnoria %s'\n" % version) except: - raise + pass +if not version: + from time import gmtime, strftime + version = 'installed on ' + strftime("%Y-%m-%dT%H:%M:%S+0000", gmtime()) +try: + os.unlink(os.path.join('src', 'version.py')) +except OSError: # Does not exist + pass +open(os.path.join('src', 'version.py'), 'a').write( + "version = '0.83.4.1+limnoria %s'\n" % version) from src.version import version