Ejemplo n.º 1
0
 def test_regular_overdated_behavior(self):
     self._clear_config_file()
     graphlab.version_info.version = "0.1.30"
     strout = StringIO.StringIO()
     ret = perform_version_check(configfile=self.config_file,
                                 _version_url=self.version_url,
                                 _feature_url=self.feature_url,
                                 _outputstream=strout)
     self.assertEqual(ret, False)
     self.assertEqual(strout.getvalue(), "")
Ejemplo n.º 2
0
 def test_regular_outdated_behavior_with_config_file_skip(self):
     config = ConfigParser.ConfigParser()
     config.add_section("Product")
     config.set('Product', 'skip_version_check', 1)
     with open(self.config_file, 'w') as f:
         config.write(f)
     graphlab.version_info.version = "0.1.1"
     strout = StringIO.StringIO()
     ret = perform_version_check(configfile=self.config_file,
                                 _version_url=self.version_url,
                                 _feature_url=self.feature_url,
                                 _outputstream=strout)
     self.assertEqual(ret, False)
     self.assertEqual(strout.getvalue(), "")
Ejemplo n.º 3
0
        import warnings
        import logging
        warnings.warn("Graph has been renamed to SGraph. The Graph class will be removed in the next release.", PendingDeprecationWarning)
        logging.warning("Graph has been renamed to SGraph. The Graph class will be removed in the next release.")

    def __call__(self, *args, **kwargs):
        self._warn()
        return self.new_target(*args, **kwargs)

    def __getattr__(self, attr):
        self._warn()
        return getattr(self.new_target, attr)

Graph = DeprecationHelper(SGraph)

perform_version_check()

################### Extension Importing ########################
import graphlab.extensions
from graphlab.extensions import ext_import

graphlab.extensions._add_meta_path()

# rewrite the extensions module
class _extensions_wrapper(object):
  def __init__(self, wrapped):
    self._wrapped = wrapped
    self.__doc__ = wrapped.__doc__

  def __getattr__(self, name):
    try: