mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Merge branch 'testing' of github.com:ProgVal/Limnoria into testing
This commit is contained in:
commit
d41d684ce1
@ -102,7 +102,10 @@ class Math(callbacks.Plugin):
|
|||||||
return cmath.sqrt(x)
|
return cmath.sqrt(x)
|
||||||
else:
|
else:
|
||||||
return math.sqrt(x)
|
return math.sqrt(x)
|
||||||
|
def _cbrt(x):
|
||||||
|
return math.pow(x, 1.0/3)
|
||||||
_mathEnv['sqrt'] = _sqrt
|
_mathEnv['sqrt'] = _sqrt
|
||||||
|
_mathEnv['cbrt'] = _cbrt
|
||||||
_mathEnv['abs'] = abs
|
_mathEnv['abs'] = abs
|
||||||
_mathEnv['max'] = max
|
_mathEnv['max'] = max
|
||||||
_mathEnv['min'] = min
|
_mathEnv['min'] = min
|
||||||
|
@ -302,7 +302,7 @@ class Misc(callbacks.Plugin):
|
|||||||
version = ''.join(version.rsplit(':', 1))
|
version = ''.join(version.rsplit(':', 1))
|
||||||
# Replace the last '-' by '+':
|
# Replace the last '-' by '+':
|
||||||
version = '+'.join(version.rsplit('-', 1))
|
version = '+'.join(version.rsplit('-', 1))
|
||||||
versions[branch] = version
|
versions[branch] = version.encode('utf-8')
|
||||||
newest = _('The newest versions available online are %s.') % \
|
newest = _('The newest versions available online are %s.') % \
|
||||||
', '.join([_('%s (in %s)') % (y,x)
|
', '.join([_('%s (in %s)') % (y,x)
|
||||||
for x,y in versions.items()])
|
for x,y in versions.items()])
|
||||||
|
@ -172,9 +172,7 @@ class GithubRepository(GitRepository):
|
|||||||
archive = self._download(plugin)
|
archive = self._download(plugin)
|
||||||
prefix = archive.getnames()[0]
|
prefix = archive.getnames()[0]
|
||||||
dirname = ''.join((self._path, plugin))
|
dirname = ''.join((self._path, plugin))
|
||||||
print repr(prefix + dirname + '/README.txt')
|
|
||||||
for file in archive.getmembers():
|
for file in archive.getmembers():
|
||||||
print repr(file)
|
|
||||||
if file.name == prefix + dirname + '/README.txt':
|
if file.name == prefix + dirname + '/README.txt':
|
||||||
extractedFile = archive.extractfile(file)
|
extractedFile = archive.extractfile(file)
|
||||||
return extractedFile.read()
|
return extractedFile.read()
|
||||||
@ -263,6 +261,8 @@ class PluginDownloader(callbacks.Plugin):
|
|||||||
which are available in that repository. When you want to install plugin,
|
which are available in that repository. When you want to install plugin,
|
||||||
just run command "install <repository> <plugin>"."""
|
just run command "install <repository> <plugin>"."""
|
||||||
|
|
||||||
|
threaded = True
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def repolist(self, irc, msg, args, repository):
|
def repolist(self, irc, msg, args, repository):
|
||||||
"""[<repository>]
|
"""[<repository>]
|
||||||
|
@ -573,6 +573,24 @@ class Topic(callbacks.Plugin):
|
|||||||
self._sendTopics(irc, channel, topics)
|
self._sendTopics(irc, channel, topics)
|
||||||
swap = wrap(swap, ['canChangeTopic', 'topicNumber', 'topicNumber'])
|
swap = wrap(swap, ['canChangeTopic', 'topicNumber', 'topicNumber'])
|
||||||
|
|
||||||
|
@internationalizeDocstring
|
||||||
|
def save(self, irc, msg, args, channel):
|
||||||
|
"""[<channel>]
|
||||||
|
|
||||||
|
Saves the topic in <channel> to be restored with @topic default
|
||||||
|
later. <channel> 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
|
@internationalizeDocstring
|
||||||
def default(self, irc, msg, args, channel):
|
def default(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
18
setup.py
18
setup.py
@ -52,6 +52,7 @@ import subprocess
|
|||||||
plugins = [s for s in os.listdir('plugins') if
|
plugins = [s for s in os.listdir('plugins') if
|
||||||
os.path.exists(os.path.join('plugins', s, 'plugin.py'))]
|
os.path.exists(os.path.join('plugins', s, 'plugin.py'))]
|
||||||
|
|
||||||
|
version = None
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
|
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
@ -60,14 +61,17 @@ try:
|
|||||||
.replace(' +', '+') \
|
.replace(' +', '+') \
|
||||||
.replace(' ', 'T')
|
.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:
|
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
|
from src.version import version
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user